示例#1
0
文件: phase_test.go 项目: bac/juju
func (s *PhaseSuite) TestCanTransitionTo(c *gc.C) {
	c.Check(migration.QUIESCE.CanTransitionTo(migration.SUCCESS), jc.IsFalse)
	c.Check(migration.QUIESCE.CanTransitionTo(migration.ABORT), jc.IsTrue)
	c.Check(migration.QUIESCE.CanTransitionTo(migration.IMPORT), jc.IsTrue)
	c.Check(migration.QUIESCE.CanTransitionTo(migration.Phase(-1)), jc.IsFalse)
	c.Check(migration.ABORT.CanTransitionTo(migration.QUIESCE), jc.IsFalse)
}
示例#2
0
文件: phase_test.go 项目: bac/juju
func (s *PhaseSuite) TestInvalid(c *gc.C) {
	c.Check(migration.Phase(-1).String(), gc.Equals, "UNKNOWN")
	c.Check(migration.Phase(9999).String(), gc.Equals, "UNKNOWN")
}
示例#3
0
文件: phase_test.go 项目: bac/juju
func (s *PhaseSuite) TestUNKNOWN(c *gc.C) {
	// 0 should be UNKNOWN to guard against uninitialised struct
	// fields.
	c.Check(migration.Phase(0), gc.Equals, migration.UNKNOWN)
}