Merge "Utilizes assertNotIn"
This commit is contained in:
commit
a668ae4e97
@ -45,8 +45,8 @@ class PortBindingsTestCase(test_db_plugin.NeutronDbPluginV2TestCase):
|
||||
|
||||
def _check_response_no_portbindings(self, port):
|
||||
self.assertTrue('status' in port)
|
||||
self.assertFalse(portbindings.VIF_TYPE in port)
|
||||
self.assertFalse(portbindings.CAPABILITIES in port)
|
||||
self.assertNotIn(portbindings.VIF_TYPE, port)
|
||||
self.assertNotIn(portbindings.CAPABILITIES, port)
|
||||
|
||||
def _get_non_admin_context(self):
|
||||
return context.Context(user_id=None,
|
||||
|
@ -1138,7 +1138,7 @@ class TestNiciraQoSQueue(NiciraPluginV2TestCase):
|
||||
tenant_id='not_admin', set_context=True)
|
||||
|
||||
port = self.deserialize('json', res)
|
||||
self.assertEqual(ext_qos.QUEUE not in port['port'], True)
|
||||
self.assertNotIn(ext_qos.QUEUE, port['port'])
|
||||
|
||||
def test_dscp_value_out_of_range(self):
|
||||
body = {'qos_queue': {'tenant_id': 'admin', 'dscp': '64',
|
||||
@ -1172,7 +1172,7 @@ class TestNiciraQoSQueue(NiciraPluginV2TestCase):
|
||||
neutron_context = context.Context('', 'not_admin')
|
||||
port = self._update('ports', port['port']['id'], data,
|
||||
neutron_context=neutron_context)
|
||||
self.assertFalse(ext_qos.QUEUE in port['port'])
|
||||
self.assertNotIn(ext_qos.QUEUE, port['port'])
|
||||
|
||||
def test_rxtx_factor(self):
|
||||
with self.qos_queue(max=10) as q1:
|
||||
@ -1438,7 +1438,7 @@ class TestNiciraMultiProviderNetworks(NiciraPluginV2TestCase):
|
||||
network = self.deserialize(self.fmt, net_req.get_response(self.api))
|
||||
for provider_field in [pnet.NETWORK_TYPE, pnet.PHYSICAL_NETWORK,
|
||||
pnet.SEGMENTATION_ID]:
|
||||
self.assertTrue(provider_field not in network['network'])
|
||||
self.assertNotIn(provider_field, network['network'])
|
||||
tz = network['network'][mpnet.SEGMENTS][0]
|
||||
self.assertEqual(tz[pnet.NETWORK_TYPE], 'vlan')
|
||||
self.assertEqual(tz[pnet.PHYSICAL_NETWORK], 'physnet1')
|
||||
|
@ -439,7 +439,7 @@ class ExtensionManagerTest(base.BaseTestCase):
|
||||
ext_mgr.add_extension(ext_stubs.StubExtension("valid_extension"))
|
||||
|
||||
self.assertTrue('valid_extension' in ext_mgr.extensions)
|
||||
self.assertFalse('invalid_extension' in ext_mgr.extensions)
|
||||
self.assertNotIn('invalid_extension', ext_mgr.extensions)
|
||||
|
||||
|
||||
class PluginAwareExtensionManagerTest(base.BaseTestCase):
|
||||
@ -454,7 +454,7 @@ class PluginAwareExtensionManagerTest(base.BaseTestCase):
|
||||
ext_mgr.add_extension(ext_stubs.StubExtension("e3"))
|
||||
|
||||
self.assertTrue("e1" in ext_mgr.extensions)
|
||||
self.assertFalse("e2" in ext_mgr.extensions)
|
||||
self.assertNotIn("e2", ext_mgr.extensions)
|
||||
self.assertTrue("e3" in ext_mgr.extensions)
|
||||
|
||||
def test_extensions_are_not_loaded_for_plugins_unaware_of_extensions(self):
|
||||
@ -469,7 +469,7 @@ class PluginAwareExtensionManagerTest(base.BaseTestCase):
|
||||
ext_mgr = extensions.PluginAwareExtensionManager('', plugin_info)
|
||||
ext_mgr.add_extension(ext_stubs.StubExtension("e1"))
|
||||
|
||||
self.assertFalse("e1" in ext_mgr.extensions)
|
||||
self.assertNotIn("e1", ext_mgr.extensions)
|
||||
|
||||
def test_extensions_not_loaded_for_plugin_without_expected_interface(self):
|
||||
|
||||
@ -482,7 +482,7 @@ class PluginAwareExtensionManagerTest(base.BaseTestCase):
|
||||
ext_mgr.add_extension(
|
||||
ext_stubs.ExtensionExpectingPluginInterface("supported_extension"))
|
||||
|
||||
self.assertFalse("e1" in ext_mgr.extensions)
|
||||
self.assertNotIn("e1", ext_mgr.extensions)
|
||||
|
||||
def test_extensions_are_loaded_for_plugin_with_expected_interface(self):
|
||||
|
||||
|
@ -561,4 +561,4 @@ class IptablesManagerStateLessTestCase(base.BaseTestCase):
|
||||
self.iptables = (iptables_manager.IptablesManager(state_less=True))
|
||||
|
||||
def test_nat_not_found(self):
|
||||
self.assertFalse('nat' in self.iptables.ipv4)
|
||||
self.assertNotIn('nat', self.iptables.ipv4)
|
||||
|
@ -48,7 +48,7 @@ class TestNeutronContext(base.BaseTestCase):
|
||||
self.assertIsNone(cxt_dict['user_id'])
|
||||
self.assertIsNone(cxt_dict['tenant_id'])
|
||||
self.assertIsNotNone(cxt.session)
|
||||
self.assertFalse('session' in cxt_dict)
|
||||
self.assertNotIn('session', cxt_dict)
|
||||
|
||||
def test_neutron_context_admin_without_session_to_dict(self):
|
||||
cxt = context.get_admin_context_without_session()
|
||||
|
Loading…
x
Reference in New Issue
Block a user