Skip to content

Commit

Permalink
Merge "Utilizes assertNotIn"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Oct 9, 2013
2 parents f3fe7fa + bdddb0b commit 434b8b0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions neutron/tests/unit/_test_extension_portbindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def _check_response_portbindings(self, port):

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,
Expand Down
6 changes: 3 additions & 3 deletions neutron/tests/unit/nicira/test_nicira_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ def test_get_port_with_qos_not_admin(self):
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',
Expand Down Expand Up @@ -1172,7 +1172,7 @@ def test_update_port_non_admin_does_not_show_queue_id(self):
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:
Expand Down Expand Up @@ -1438,7 +1438,7 @@ def test_create_network_single_multiple_provider(self):
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')
Expand Down
8 changes: 4 additions & 4 deletions neutron/tests/unit/test_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def get_alias(self):
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):
Expand All @@ -454,7 +454,7 @@ def test_unsupported_extensions_are_not_loaded(self):
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):
Expand All @@ -469,7 +469,7 @@ class ExtensionUnawarePlugin(object):
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):

Expand All @@ -482,7 +482,7 @@ class PluginWithoutExpectedIface(object):
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):

Expand Down
2 changes: 1 addition & 1 deletion neutron/tests/unit/test_iptables_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,4 +561,4 @@ def setUp(self):
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)
2 changes: 1 addition & 1 deletion neutron/tests/unit/test_neutron_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_neutron_context_admin_to_dict(self):
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()
Expand Down

0 comments on commit 434b8b0

Please sign in to comment.