Python 3: do not use types.ClassType
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
This commit is contained in:
parent
a34ad90ee8
commit
e2fb74e196
|
@ -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)
|
||||
|
|
|
@ -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):
|
||||
|
|
1
tox.ini
1
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 \
|
||||
|
|
Loading…
Reference in New Issue