Merge "add mock for test_create_flavor_not_allowed"
This commit is contained in:
commit
a0976991b3
@ -538,6 +538,10 @@ class TestFlavors(BaseConfigTempestTest):
|
|||||||
mock_function.assert_has_calls(calls, any_order=True)
|
mock_function.assert_has_calls(calls, any_order=True)
|
||||||
|
|
||||||
def test_create_flavor_not_allowed(self):
|
def test_create_flavor_not_allowed(self):
|
||||||
|
# mock list_flavors() to return empty list
|
||||||
|
mock_function = mock.Mock(return_value={"flavors": []})
|
||||||
|
self.useFixture(MonkeyPatch(self.CLIENT_MOCK + '.list_flavors',
|
||||||
|
mock_function))
|
||||||
exc = Exception
|
exc = Exception
|
||||||
self.assertRaises(exc,
|
self.assertRaises(exc,
|
||||||
tool.find_or_create_flavor,
|
tool.find_or_create_flavor,
|
||||||
|
Loading…
Reference in New Issue
Block a user