summaryrefslogtreecommitdiff
path: root/openstackclient/tests/compute
diff options
context:
space:
mode:
authorTang Chen <chen.tang@easystack.cn>2016-06-21 15:15:18 +0800
committerTang Chen <chen.tang@easystack.cn>2016-06-21 15:15:18 +0800
commit9c62af8a42ebfeb60d88f5ad0af7c1c2fd562853 (patch)
tree2ec2096d6013b8f424b13128a1f438e70024eeeb /openstackclient/tests/compute
parent7cda2b2a066cd45c7aeb9a6d92c1a83e49d48128 (diff)
downloadpython-openstackclient-9c62af8a42ebfeb60d88f5ad0af7c1c2fd562853.tar.gz
Make set/unset commands in compute/image/common return normally when nothing specified
After this patch, all set/unset commands will return normally when nothing specified. Change-Id: Id94d0329faa1a674006a9aae901f834b41917317 Close-bug: #1588588
Diffstat (limited to 'openstackclient/tests/compute')
-rw-r--r--openstackclient/tests/compute/v2/test_flavor.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/openstackclient/tests/compute/v2/test_flavor.py b/openstackclient/tests/compute/v2/test_flavor.py
index 4365a540..864a4327 100644
--- a/openstackclient/tests/compute/v2/test_flavor.py
+++ b/openstackclient/tests/compute/v2/test_flavor.py
@@ -542,8 +542,12 @@ class TestFlavorSet(TestFlavor):
('flavor', self.flavor.id),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
- self.assertRaises(exceptions.CommandError, self.cmd.take_action,
- parsed_args)
+ result = self.cmd.take_action(parsed_args)
+
+ self.flavors_mock.find.assert_called_with(name=parsed_args.flavor,
+ is_public=None)
+ self.flavor_access_mock.add_tenant_access.assert_not_called()
+ self.assertIsNone(result)
class TestFlavorShow(TestFlavor):
@@ -717,5 +721,8 @@ class TestFlavorUnset(TestFlavor):
('flavor', self.flavor.id),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
- self.assertRaises(exceptions.CommandError, self.cmd.take_action,
- parsed_args)
+
+ result = self.cmd.take_action(parsed_args)
+ self.assertIsNone(result)
+
+ self.flavor_access_mock.remove_tenant_access.assert_not_called()