@mock.patch.object(stack.Stack, 'purge_db')
def test_mark_complete_update(self, mock_purge_db):
    tmpl = template.Template({'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'foo': {'Type': 'GenericResourceType'}}})
    cfg.CONF.set_default('convergence_engine', True)
    tmpl_stack = stack.Stack(self.ctx, 'test', tmpl, convergence=True)
    tmpl_stack.prev_raw_template_id = 1
    tmpl_stack.action = tmpl_stack.UPDATE
    tmpl_stack.status = tmpl_stack.IN_PROGRESS
    tmpl_stack.current_traversal = 'some-traversal'
    tmpl_stack.store()
    tmpl_stack.mark_complete()
    self.assertTrue(mock_purge_db.called)
@mock.patch.object(stack.Stack, 'purge_db')
def test_mark_complete_update(self, mock_purge_db):
    tmpl = template.Template({'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'foo': {'Type': 'GenericResourceType'}}})
    cfg.CONF.set_default('convergence_engine', True)
    tmpl_stack = stack.Stack(self.ctx, 'test', tmpl, convergence=True)
    tmpl_stack.prev_raw_template_id = 1
    tmpl_stack.action = tmpl_stack.UPDATE
    tmpl_stack.status = tmpl_stack.IN_PROGRESS
    tmpl_stack.current_traversal = 'some-traversal'
    tmpl_stack.store()
    tmpl_stack.mark_complete()
    self.assertTrue(mock_purge_db.called)