func assertPhase(c *gc.C, mig state.ModelMigration, phase migration.Phase) { actualPhase, err := mig.Phase() c.Assert(err, jc.ErrorIsNil) c.Check(actualPhase, gc.Equals, phase) }
func checkIdAndAttempt(c *gc.C, mig state.ModelMigration, expected int) { c.Check(mig.Id(), gc.Equals, fmt.Sprintf("%s:%d", mig.ModelUUID(), expected)) attempt, err := mig.Attempt() c.Assert(err, jc.ErrorIsNil) c.Check(attempt, gc.Equals, expected) }
func (s *MigrationSuite) assertMigrationCleanedUp(c *gc.C, mig state.ModelMigration) { c.Assert(mig.PhaseChangedTime(), gc.Equals, s.clock.Now()) c.Assert(mig.EndTime(), gc.Equals, s.clock.Now()) assertMigrationNotActive(c, s.State2) }