]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Python 3: do not use types.ClassType
authorCyril Roelandt <cyril@redhat.com>
Wed, 15 Jul 2015 11:54:51 +0000 (11:54 +0000)
committerCyril Roelandt <cyril@redhat.com>
Wed, 15 Jul 2015 22:58:40 +0000 (00:58 +0200)
In Python 3, one should just use 'type'. Still, the use of "ClassType" does not
seem necessary here, so just fix the tests.

Change-Id: I5574926fc338110cc989bf185fa454ec26f4d530
Blueprint: neutron-python3

neutron/tests/unit/ipam/test_requests.py
neutron/tests/unit/test_manager.py
tox.ini

index 8fd014c0982ccda25115e850efbd3d69d8c618f6..e15f3a7f4e1df2a5a06c9417d65f6e8655ae16cf 100644 (file)
@@ -10,8 +10,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import types
-
 import mock
 import netaddr
 from oslo_config import cfg
@@ -277,7 +275,7 @@ class TestIpamDriverLoader(base.BaseTestCase):
     def test_ipam_driver_is_loaded_from_ipam_driver_config_value(self):
         ipam_driver = self._load_ipam_driver('fake', None)
         self.assertIsInstance(
-            ipam_driver, (fake_driver.FakeDriver, types.ClassType),
+            ipam_driver, fake_driver.FakeDriver,
             "loaded ipam driver should be of type FakeDriver")
 
     @mock.patch(FAKE_IPAM_CLASS)
index 59ecb58a88e3aa610d5f205cfd2697e8e3a52663..b3d3916f9648ebebab322a7cfc79fc48feeea0b8 100644 (file)
@@ -13,8 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import types
-
 import fixtures
 from oslo_config import cfg
 from oslo_log import log as logging
@@ -56,7 +54,7 @@ class NeutronManagerTestCase(base.BaseTestCase):
         plugin = mgr.get_service_plugins()[constants.DUMMY]
 
         self.assertIsInstance(
-            plugin, (dummy_plugin.DummyServicePlugin, types.ClassType),
+            plugin, dummy_plugin.DummyServicePlugin,
             "loaded plugin should be of type neutronDummyPlugin")
 
     def test_service_plugin_by_name_is_loaded(self):
@@ -66,7 +64,7 @@ class NeutronManagerTestCase(base.BaseTestCase):
         plugin = mgr.get_service_plugins()[constants.DUMMY]
 
         self.assertIsInstance(
-            plugin, (dummy_plugin.DummyServicePlugin, types.ClassType),
+            plugin, dummy_plugin.DummyServicePlugin,
             "loaded plugin should be of type neutronDummyPlugin")
 
     def test_multiple_plugins_specified_for_service_type(self):
diff --git a/tox.ini b/tox.ini
index 292aa122287e2751f165c4cab2bb1fddd4fc24dd..8ff3b2d7004765e4b20ed015c8255dd7444b0811 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -195,6 +195,7 @@ commands = python -m testtools.run \
     neutron.tests.unit.agent.linux.test_bridge_lib \
     neutron.tests.unit.agent.linux.test_ip_link_support \
     neutron.tests.unit.agent.linux.test_interface \
+    neutron.tests.unit.test_manager \
     neutron.tests.unit.test_auth \
     neutron.tests.unit.test_policy \
     neutron.tests.unit.extensions.v2attributes \