Пример #1
0
 def test_get_status_expired(self, active, expiration, start_end):
     active.return_value = 5
     start_end.return_value = (datetime.datetime.now(), None)
     expiration.side_effect = stage.Error('Expired')
     self.assertEqual(stage.get_status(), 'Expired')
     self.assertTrue(expiration.called)
Пример #2
0
 def test_get_status_complete(self, active, start_end):
     active.return_value = 5
     start_end.return_value = (datetime.datetime.now(),
                               datetime.datetime.now())
     self.assertEqual(stage.get_status(), 'Complete')
Пример #3
0
 def test_get_status_running(self, active, expiration, start_end):
     active.return_value = 5
     start_end.return_value = (datetime.datetime.now(), None)
     self.assertEqual(stage.get_status(), 'Running')
     self.assertTrue(expiration.called)
Пример #4
0
 def test_get_status_unknown(self, active):
     active.return_value = None
     self.assertEqual(stage.get_status(), 'Unknown')
Пример #5
0
 def test_get_status_no_start(self, active, start_end):
     active.return_value = 4
     start_end.return_value = (None, None)
     self.assertEqual(stage.get_status(), 'Unknown')