Merge "Fix isinstance assertions"

This commit is contained in:
Jenkins 2014-07-08 08:44:04 +00:00 committed by Gerrit Code Review
commit 614479c5d5
2 changed files with 5 additions and 7 deletions

View File

@ -1429,7 +1429,7 @@ class TestConvertIPPrefixToCIDR(base.BaseTestCase):
class TestConvertProtocol(base.BaseTestCase):
def test_convert_numeric_protocol(self):
assert(isinstance(ext_sg.convert_protocol('2'), str))
self.assertIsInstance(ext_sg.convert_protocol('2'), str)
def test_convert_bad_protocol(self):
for val in ['bad', '256', '-1']:

View File

@ -56,9 +56,8 @@ class NeutronManagerTestCase(base.BaseTestCase):
mgr = manager.NeutronManager.get_instance()
plugin = mgr.get_service_plugins()[constants.DUMMY]
self.assertTrue(
isinstance(plugin,
(dummy_plugin.DummyServicePlugin, types.ClassType)),
self.assertIsInstance(
plugin, (dummy_plugin.DummyServicePlugin, types.ClassType),
"loaded plugin should be of type neutronDummyPlugin")
def test_service_plugin_by_name_is_loaded(self):
@ -67,9 +66,8 @@ class NeutronManagerTestCase(base.BaseTestCase):
mgr = manager.NeutronManager.get_instance()
plugin = mgr.get_service_plugins()[constants.DUMMY]
self.assertTrue(
isinstance(plugin,
(dummy_plugin.DummyServicePlugin, types.ClassType)),
self.assertIsInstance(
plugin, (dummy_plugin.DummyServicePlugin, types.ClassType),
"loaded plugin should be of type neutronDummyPlugin")
def test_multiple_plugins_specified_for_service_type(self):