summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-12-08 17:46:30 +0000
committerGerrit Code Review <review@openstack.org>2016-12-08 17:46:30 +0000
commitd09fd7d8326349ec10bf4152177528f39cac7ec7 (patch)
tree47747d6e2fadccb8d66a6b6d11194a8cf4ca5a7c /openstackclient/tests
parentf18328e5bfcf553ccb55909976ce097660050d72 (diff)
parentbbfd8cb46bc7493971173f1cbc774ef4697ddfe4 (diff)
downloadpython-openstackclient-d09fd7d8326349ec10bf4152177528f39cac7ec7.tar.gz
Merge "Add '--force' option to 'volume snapshot delete' command"
Diffstat (limited to 'openstackclient/tests')
-rw-r--r--openstackclient/tests/unit/volume/v2/test_snapshot.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/openstackclient/tests/unit/volume/v2/test_snapshot.py b/openstackclient/tests/unit/volume/v2/test_snapshot.py
index bb238135..cedf21a9 100644
--- a/openstackclient/tests/unit/volume/v2/test_snapshot.py
+++ b/openstackclient/tests/unit/volume/v2/test_snapshot.py
@@ -179,7 +179,24 @@ class TestSnapshotDelete(TestSnapshot):
result = self.cmd.take_action(parsed_args)
self.snapshots_mock.delete.assert_called_with(
- self.snapshots[0].id)
+ self.snapshots[0].id, False)
+ self.assertIsNone(result)
+
+ def test_snapshot_delete_with_force(self):
+ arglist = [
+ '--force',
+ self.snapshots[0].id
+ ]
+ verifylist = [
+ ('force', True),
+ ("snapshots", [self.snapshots[0].id])
+ ]
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+
+ result = self.cmd.take_action(parsed_args)
+
+ self.snapshots_mock.delete.assert_called_with(
+ self.snapshots[0].id, True)
self.assertIsNone(result)
def test_delete_multiple_snapshots(self):
@@ -195,7 +212,7 @@ class TestSnapshotDelete(TestSnapshot):
calls = []
for s in self.snapshots:
- calls.append(call(s.id))
+ calls.append(call(s.id, False))
self.snapshots_mock.delete.assert_has_calls(calls)
self.assertIsNone(result)
@@ -226,7 +243,7 @@ class TestSnapshotDelete(TestSnapshot):
self.assertEqual(2, find_mock.call_count)
self.snapshots_mock.delete.assert_called_once_with(
- self.snapshots[0].id
+ self.snapshots[0].id, False
)