示例#1
0
 def test_unhealthy_terminating(self):
     logger.debug('TestGetInstanceStatus.test_unhealthy_terminating')
     self.mock_resp['HealthStatus'] = 'UNHEALTHY'
     self.mock_resp['LifecycleState'] = 'Terminating'
     asg_helper.autoscaling = Mock(**self.mock_attrs)
     res = asg_helper.get_instance_status(self.instance_id)
     self.assertEqual(res, strs.asg_instance_terminated)
示例#2
0
 def test_unhealthy_inservice(self):
     logger.debug('TestGetInstanceStatus.test_unhealthy_inservice')
     self.mock_resp['HealthStatus'] = 'UNHEALTHY'
     asg_helper.autoscaling = Mock(**self.mock_attrs)
     res = asg_helper.get_instance_status(self.instance_id)
     self.assertEqual(res, strs.asg_instance_pending)
示例#3
0
 def test_healthy_pending(self):
     logger.debug('TestGetInstanceStatus.test_healthy_pending')
     self.mock_resp['LifecycleState'] = 'Pending'
     asg_helper.autoscaling = Mock(**self.mock_attrs)
     res = asg_helper.get_instance_status(self.instance_id)
     self.assertEqual(res, strs.asg_instance_pending)
示例#4
0
 def test_healthy_inservice(self):
     logger.debug('TestGetInstanceStatus.test_healthy_inservice')
     asg_helper.autoscaling = Mock(**self.mock_attrs)
     res = asg_helper.get_instance_status(self.instance_id)
     self.assertEqual(res, strs.asg_instance_healthy)
示例#5
0
 def test_unknown_instance(self):
     logger.debug('TestGetInstanceStatus.test_unknown_instance')
     self.mock_attrs['describe_auto_scaling_instances.return_value'] = {'AutoScalingInstances': []}
     asg_helper.autoscaling = Mock(**self.mock_attrs)
     res = asg_helper.get_instance_status(self.instance_id)
     self.assertEqual(res, strs.asg_instance_terminated)
示例#6
0
 def test_protected_from_scalein(self):
     logger.debug('TestGetInstanceStatus.test_protected_from_scalein')
     self.mock_resp['ProtectedFromScaleIn'] = True
     asg_helper.autoscaling = Mock(**self.mock_attrs)
     res = asg_helper.get_instance_status(self.instance_id)
     self.assertEqual(res, strs.asg_instance_protected)
示例#7
0
 def test_healthy_entering_standby(self):
     logger.debug('TestGetInstanceStatus.test_healthy_entering_standby')
     self.mock_resp['LifecycleState'] = 'EnteringStandby'
     asg_helper.autoscaling = Mock(**self.mock_attrs)
     res = asg_helper.get_instance_status(self.instance_id)
     self.assertEqual(res, strs.asg_instance_protected)