Example #1
0
 def test_is_terminal_state_running(self, mock_config, **kwargs):
     '''is_terminal_state returns false for running instance'''
     self.assertFalse(DiscoAWS.is_terminal_state(self.instance))
Example #2
0
 def test_is_terminal_state_termianted(self, mock_config, **kwargs):
     '''is_terminal_state returns true if instance has terminated or failed to start'''
     self.instance.state = "terminated"
     self.assertTrue(DiscoAWS.is_terminal_state(self.instance))
     self.instance.state = "failed"
     self.assertTrue(DiscoAWS.is_terminal_state(self.instance))
Example #3
0
 def test_is_terminal_state_updates(self, mock_config, **kwargs):
     '''is_terminal_state calls instance update'''
     DiscoAWS.is_terminal_state(self.instance)
     self.assertEqual(self.instance.update.call_count, 1)
Example #4
0
 def test_is_terminal_state_running(self, mock_config, **kwargs):
     '''is_terminal_state returns false for running instance'''
     self.assertFalse(DiscoAWS.is_terminal_state(self.instance))
Example #5
0
 def test_is_terminal_state_termianted(self, mock_config, **kwargs):
     '''is_terminal_state returns true if instance has terminated or failed to start'''
     self.instance.state = "terminated"
     self.assertTrue(DiscoAWS.is_terminal_state(self.instance))
     self.instance.state = "failed"
     self.assertTrue(DiscoAWS.is_terminal_state(self.instance))
Example #6
0
 def test_is_terminal_state_updates(self, mock_config, **kwargs):
     '''is_terminal_state calls instance update'''
     DiscoAWS.is_terminal_state(self.instance)
     self.assertEqual(self.instance.update.call_count, 1)