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
This commit is contained in:
@@ -491,17 +491,15 @@ class TestFlavorSet(TestFlavor):
|
|||||||
|
|
||||||
def test_flavor_set_no_project(self):
|
def test_flavor_set_no_project(self):
|
||||||
arglist = [
|
arglist = [
|
||||||
'--project', '',
|
'--project',
|
||||||
self.flavor.id,
|
self.flavor.id,
|
||||||
]
|
]
|
||||||
verifylist = [
|
verifylist = [
|
||||||
('project', ''),
|
('project', ''),
|
||||||
('flavor', self.flavor.id),
|
('flavor', self.flavor.id),
|
||||||
]
|
]
|
||||||
|
self.assertRaises(tests_utils.ParserException, self.check_parser,
|
||||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
self.cmd, arglist, verifylist)
|
||||||
self.assertRaises(exceptions.CommandError, self.cmd.take_action,
|
|
||||||
parsed_args)
|
|
||||||
|
|
||||||
def test_flavor_set_no_flavor(self):
|
def test_flavor_set_no_flavor(self):
|
||||||
arglist = [
|
arglist = [
|
||||||
|
Reference in New Issue
Block a user