summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorTang Chen <chen.tang@easystack.cn>2016-06-03 15:53:49 +0800
committerTang Chen <chen.tang@easystack.cn>2016-06-03 15:53:49 +0800
commitc95c73f8e239301b3be7a5264dcb87293cf2dad5 (patch)
tree5102203783548aaff07c2c98078b76b32588e460 /openstackclient
parent9f65a9954c0563038f3223700bc9f8205addbc79 (diff)
downloadpython-openstackclient-c95c73f8e239301b3be7a5264dcb87293cf2dad5.tar.gz
Fix wrong test in flavor unit tests
In test_flavor_set_no_project(), we aimed to test a situation like this: User specifies "--project" option, but didn't specifies the project name or ID. But in the source code, it becomes "--project ''". The test could past because if project and property are both None, the command will raise an exception. Change-Id: I39567306debb901e8bad420fa2492f1b207efddc
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/tests/compute/v2/test_flavor.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/openstackclient/tests/compute/v2/test_flavor.py b/openstackclient/tests/compute/v2/test_flavor.py
index 9d424890..434d5f92 100644
--- a/openstackclient/tests/compute/v2/test_flavor.py
+++ b/openstackclient/tests/compute/v2/test_flavor.py
@@ -491,17 +491,15 @@ class TestFlavorSet(TestFlavor):
def test_flavor_set_no_project(self):
arglist = [
- '--project', '',
+ '--project',
self.flavor.id,
]
verifylist = [
('project', ''),
('flavor', self.flavor.id),
]
-
- parsed_args = self.check_parser(self.cmd, arglist, verifylist)
- self.assertRaises(exceptions.CommandError, self.cmd.take_action,
- parsed_args)
+ self.assertRaises(tests_utils.ParserException, self.check_parser,
+ self.cmd, arglist, verifylist)
def test_flavor_set_no_flavor(self):
arglist = [