@mock.patch.object(stack_object.Stack, 'delete')
@mock.patch.object(raw_template_object.RawTemplate, 'delete')
def test_mark_complete_create(self, mock_tmpl_delete, mock_stack_delete):
    tmpl = template.Template({'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'foo': {'Type': 'GenericResourceType'}}})
    tmpl_stack = stack.Stack(self.ctx, 'test', tmpl, convergence=True)
    tmpl_stack.store()
    tmpl_stack.action = tmpl_stack.CREATE
    tmpl_stack.status = tmpl_stack.IN_PROGRESS
    tmpl_stack.current_traversal = 'some-traversal'
    tmpl_stack.mark_complete()
    self.assertEqual(tmpl_stack.prev_raw_template_id, None)
    self.assertFalse(mock_tmpl_delete.called)
    self.assertFalse(mock_stack_delete.called)
    self.assertEqual(tmpl_stack.status, tmpl_stack.COMPLETE)
@mock.patch.object(stack_object.Stack, 'delete')
@mock.patch.object(raw_template_object.RawTemplate, 'delete')
def test_mark_complete_create(self, mock_tmpl_delete, mock_stack_delete):
    tmpl = template.Template({'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'foo': {'Type': 'GenericResourceType'}}})
    tmpl_stack = stack.Stack(self.ctx, 'test', tmpl, convergence=True)
    tmpl_stack.store()
    tmpl_stack.action = tmpl_stack.CREATE
    tmpl_stack.status = tmpl_stack.IN_PROGRESS
    tmpl_stack.current_traversal = 'some-traversal'
    tmpl_stack.mark_complete()
    self.assertEqual(tmpl_stack.prev_raw_template_id, None)
    self.assertFalse(mock_tmpl_delete.called)
    self.assertFalse(mock_stack_delete.called)
    self.assertEqual(tmpl_stack.status, tmpl_stack.COMPLETE)