@mock.patch.object(stack_object.Stack, 'select_and_update')
def test_store_uses_traversal_id_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)
    mock_sau.return_value = True
    self.stack.id = 1
    self.stack.current_traversal = 1
    stack_id = self.stack.store()
    mock_sau.assert_called_once_with(mock.ANY, 1, mock.ANY, exp_trvsl=1)
    self.assertEqual(1, stack_id)
    stack_id = self.stack.store(exp_trvsl=2)
    self.assertEqual(1, stack_id)
    mock_sau.assert_called_with(mock.ANY, 1, mock.ANY, exp_trvsl=2)
@mock.patch.object(stack_object.Stack, 'select_and_update')
def test_store_uses_traversal_id_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)
    mock_sau.return_value = True
    self.stack.id = 1
    self.stack.current_traversal = 1
    stack_id = self.stack.store()
    mock_sau.assert_called_once_with(mock.ANY, 1, mock.ANY, exp_trvsl=1)
    self.assertEqual(1, stack_id)
    stack_id = self.stack.store(exp_trvsl=2)
    self.assertEqual(1, stack_id)
    mock_sau.assert_called_with(mock.ANY, 1, mock.ANY, exp_trvsl=2)