Exemple #1
0
    def test_success(self):
        """HeatStack instances should be returned from JSON."""
        expected_stacks = [
            stack(id='a', name='aa', action='CREATE', status='COMPLETE'),
            stack(id='b', name='bb', action='CREATE', status='COMPLETE')
        ]
        eff = get_all_launch_stack_data(
            'tid',
            'gid',
            self.now,
            get_scaling_group_stacks=_constant_as_eff(('gid',), self.stacks))

        self.assertEqual(resolve_stubs(eff), {'stacks': expected_stacks})
Exemple #2
0
 def setUp(self):
     self.config = pmap({'foo': 'bar', 'stack_name': 'to_be_removed'})
     self.config_after = {'foo': 'bar'}
     self.stack = stack(id='foo_id', name='foo_name')
     self.update_call = update_stack(stack_name=self.stack.name,
                                     stack_id=self.stack.id,
                                     stack_args=self.config_after)
Exemple #3
0
 def test_ensure_retry(self):
     """Tests that retry will be returned."""
     seq = [
         (delete_stack(stack_id='foo', stack_name='bar').intent,
          lambda _: (StubResponse(204, ''), None)),
         (Log('request-delete-stack', ANY), lambda _: None)
     ]
     foo_stack = stack(id='foo', name='bar')
     delete = DeleteStack(foo_stack)
     reason = ('Waiting for stack to delete')
     result = perform_sequence(seq, delete.as_effect())
     self.assertEqual(result,
                      (StepResult.RETRY, [ErrorReason.String(reason)]))
Exemple #4
0
 def test_normal_use(self):
     """Tests normal usage."""
     foo_stack = stack(id='foo', name='bar')
     delete = DeleteStack(foo_stack)
     self.assertEqual(delete.as_effect().intent,
                      delete_stack(stack_id='foo', stack_name='bar').intent)
Exemple #5
0
 def setUp(self):
     self.stack = stack(id='some_id', name='some_name')
     self.check_call = check_stack(stack_name=self.stack.name,
                                   stack_id=self.stack.id)
Exemple #6
0
 def test_normal_use(self):
     """Tests normal usage."""
     foo_stack = stack(id='foo', name='bar')
     delete = DeleteStack(foo_stack)
     self.assertEqual(delete.as_effect().intent,
                      delete_stack(stack_id='foo', stack_name='bar').intent)
Exemple #7
0
 def setUp(self):
     self.stack = stack(id='some_id', name='some_name')
     self.check_call = check_stack(stack_name=self.stack.name,
                                   stack_id=self.stack.id)