예제 #1
0
    def test_AutoscalingLifecycleHook_status(self):
        test_instance = lifecycle_hook.AutoscalingLifecycleHook(
            "ctx_node", resource_id='hook_id', client=self.fake_client,
            logger=None
        )

        self.assertEqual(test_instance.status, None)
예제 #2
0
    def test_AutoscalingLifecycleHook_status_NotEmpty(self):
        self.fake_client.describe_lifecycle_hooks = MagicMock(
            return_value={'LifecycleHooks': ['SomeHook']})

        test_instance = lifecycle_hook.AutoscalingLifecycleHook(
            "ctx_node",
            resource_id='hook_id',
            client=self.fake_client,
            logger=None)

        self.assertEqual(test_instance.status, None)
예제 #3
0
    def test_AutoscalingLifecycleHook_properties_not_empty(self):
        test_instance = lifecycle_hook.AutoscalingLifecycleHook(
            "ctx_node",
            resource_id='hook_id',
            client=self.fake_client,
            logger=None)

        self.fake_client.describe_lifecycle_hooks = MagicMock(
            return_value={'LifecycleHooks': ['SomeHook']})

        self.assertEqual(test_instance.properties, 'SomeHook')

        self.fake_client.describe_lifecycle_hooks.assert_called_with(
            LifecycleHookNames=['hook_id'])