Esempio n. 1
0
 def test_status_terminated(self):
     """
     Instance status should revert to 'empty' when all its servers are terminated
     """
     instance = OpenEdXInstanceFactory()
     server = StartedOpenStackServerFactory(instance=instance)
     self.assertEqual(instance.status, instance.STARTED)
     server.status = 'terminated'
     server.save()
     self.assertEqual(instance.status, instance.EMPTY)
Esempio n. 2
0
 def test_status(self):
     """
     Instance status with one active server
     """
     instance = OpenEdXInstanceFactory()
     self.assertEqual(instance.status, instance.EMPTY)
     server = StartedOpenStackServerFactory(instance=instance)
     self.assertEqual(instance.status, instance.STARTED)
     server.status = server.BOOTED
     server.save()
     self.assertEqual(instance.status, instance.BOOTED)