diff --git a/heatclient/tests/test_stacks.py b/heatclient/tests/test_stacks.py index 9ebcc3cf..722a9eb8 100644 --- a/heatclient/tests/test_stacks.py +++ b/heatclient/tests/test_stacks.py @@ -15,6 +15,7 @@ from heatclient.v1.stacks import Stack +from mock import MagicMock import testscenarios from testscenarios.scenarios import multiply_scenarios import testtools @@ -43,3 +44,12 @@ class StackStatusActionTest(testtools.TestCase): stack = Stack(None, {'stack_status': stack_status}) self.assertEqual(self.action, stack.action) self.assertEqual(self.status, stack.status) + + +class StackOperationsTest(testtools.TestCase): + + def test_delete_stack(self): + manager = MagicMock() + stack = Stack(manager, {'id': 'abcd1234'}) + stack.delete() + manager.delete.assert_called_once_with('abcd1234') diff --git a/heatclient/v1/stacks.py b/heatclient/v1/stacks.py index 05ecd6b8..dabe8dd2 100644 --- a/heatclient/v1/stacks.py +++ b/heatclient/v1/stacks.py @@ -28,7 +28,7 @@ class Stack(base.Resource): self.manager.update(self, **fields) def delete(self): - return self.manager.delete(self) + return self.manager.delete(self.id) def data(self, **kwargs): return self.manager.data(self, **kwargs)