@mock.patch.object(stack_object.Stack, 'select_and_update')
def test_state_set_uses_curr_traversal_for_updating_db(self, mock_sau):
    tmpl = template.Template({'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'foo': {'Type': 'GenericResourceType'}}})
    self.stack = stack.Stack(utils.dummy_context(), 'test_stack', tmpl, convergence=True)
    self.stack.id = 1
    self.stack.current_traversal = 'curr-traversal'
    self.stack.store()
    self.stack.state_set(self.stack.UPDATE, self.stack.IN_PROGRESS, '')
    mock_sau.assert_called_once_with(mock.ANY, 1, mock.ANY, exp_trvsl='curr-traversal')
@mock.patch.object(stack_object.Stack, 'select_and_update')
def test_state_set_uses_curr_traversal_for_updating_db(self, mock_sau):
    tmpl = template.Template({'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'foo': {'Type': 'GenericResourceType'}}})
    self.stack = stack.Stack(utils.dummy_context(), 'test_stack', tmpl, convergence=True)
    self.stack.id = 1
    self.stack.current_traversal = 'curr-traversal'
    self.stack.store()
    self.stack.state_set(self.stack.UPDATE, self.stack.IN_PROGRESS, )
    mock_sau.assert_called_once_with(mock.ANY, 1, mock.ANY, exp_trvsl='curr-traversal')