Merge "Fix test_requires_ext_decorator_with_all_ext_enabled"

This commit is contained in:
Jenkins 2016-04-07 17:54:23 +00:00 committed by Gerrit Code Review
commit 75996a570b

View File

@ -201,7 +201,13 @@ class TestRequiresExtDecorator(BaseDecoratorsTest):
if expected_to_skip:
self.assertRaises(testtools.TestCase.skipException, t.test_bar)
else:
self.assertEqual(t.test_bar(), 0)
try:
self.assertEqual(t.test_bar(), 0)
except testtools.TestCase.skipException:
# We caught a skipException but we didn't expect to skip
# this test so raise a hard test failure instead.
raise testtools.TestCase.failureException(
"Not supposed to skip")
def test_requires_ext_decorator(self):
self._test_requires_ext_helper(expected_to_skip=False,
@ -213,7 +219,7 @@ class TestRequiresExtDecorator(BaseDecoratorsTest):
service='compute')
def test_requires_ext_decorator_with_all_ext_enabled(self):
cfg.CONF.set_default('api_extensions', 'all',
cfg.CONF.set_default('api_extensions', ['all'],
group='compute-feature-enabled')
self._test_requires_ext_helper(expected_to_skip=False,
extension='random_ext',