diff options
| author | Jenkins <jenkins@review.openstack.org> | 2017-01-26 06:38:31 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2017-01-26 06:38:31 +0000 |
| commit | da2a820d2f4e5589671f494edcd8e8b3e69b7cb0 (patch) | |
| tree | 741b3f26bfc312ddcc546da63a306984ad6462d2 /openstackclient/tests/unit/volume/v1 | |
| parent | d189e807fdfc7222b18844a56db2e43412f49abb (diff) | |
| parent | 26d50be79a401322f4e74b94c066257ddf0f287c (diff) | |
| download | python-openstackclient-da2a820d2f4e5589671f494edcd8e8b3e69b7cb0.tar.gz | |
Merge "Support "--no-property" option in volume snapshot set"
Diffstat (limited to 'openstackclient/tests/unit/volume/v1')
| -rw-r--r-- | openstackclient/tests/unit/volume/v1/test_snapshot.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/openstackclient/tests/unit/volume/v1/test_snapshot.py b/openstackclient/tests/unit/volume/v1/test_snapshot.py index fd878f45..87a62b0a 100644 --- a/openstackclient/tests/unit/volume/v1/test_snapshot.py +++ b/openstackclient/tests/unit/volume/v1/test_snapshot.py @@ -429,15 +429,17 @@ class TestSnapshotSet(TestSnapshot): arglist = [ "--name", "new_snapshot", "--description", "new_description", - "--property", "x=y", - "--property", "foo=foo", + "--property", "foo_1=foo_1", + "--property", "foo_2=foo_2", + "--no-property", self.snapshot.id, ] - new_property = {"x": "y", "foo": "foo"} + new_property = {"foo_1": "foo_1", "foo_2": "foo_2"} verifylist = [ ("name", "new_snapshot"), ("description", "new_description"), ("property", new_property), + ("no_property", True), ("snapshot", self.snapshot.id), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -449,8 +451,11 @@ class TestSnapshotSet(TestSnapshot): "display_description": "new_description", } self.snapshot.update.assert_called_with(**kwargs) + self.snapshots_mock.delete_metadata.assert_called_with( + self.snapshot.id, ["foo"] + ) self.snapshots_mock.set_metadata.assert_called_with( - self.snapshot.id, new_property + self.snapshot.id, {"foo_2": "foo_2", "foo_1": "foo_1"} ) self.assertIsNone(result) |
