Browse Source

Fix misuse of assertTrue/assertFalse

Change-Id: I247705feeb71e20ad5260b0ca1da08de7290ba6e
Closes-Bug: #1819982
Takashi NATSUME 1 month ago
parent
commit
86b3993cee

+ 2
- 2
neutron/tests/unit/notifiers/test_nova.py View File

@@ -167,7 +167,7 @@ class TestNovaNotify(base.BaseTestCase):
167 167
 
168 168
         event = self.nova_notifier.create_port_changed_event(
169 169
             'create_floatingip', {}, returned_obj)
170
-        self.assertFalse(event, None)
170
+        self.assertIsNone(event)
171 171
 
172 172
     def test_delete_floatingip_notify(self):
173 173
         device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87'
@@ -233,7 +233,7 @@ class TestNovaNotify(base.BaseTestCase):
233 233
                                'send_events') as send_events:
234 234
             self.nova_notifier.send_network_change('update_floatingip',
235 235
                                                    {}, {})
236
-            self.assertFalse(send_events.called, False)
236
+            self.assertFalse(send_events.called)
237 237
 
238 238
     @mock.patch('novaclient.client.Client')
239 239
     def test_nova_send_events_returns_bad_list(self, mock_client):

+ 1
- 1
neutron/tests/unit/services/placement_report/test_plugin.py View File

@@ -188,7 +188,7 @@ class PlacementReporterAgentsTestCases(test_plugin.Ml2PluginV2TestCase):
188 188
         self.agents = plugin.PlacementReporterAgents(ml2_plugin=self.plugin)
189 189
         mech_driver = self.agents.mechanism_driver_by_agent_type(
190 190
             'test_mechanism_driver_agent')
191
-        self.assertTrue(mech_driver, mechanism_test.TestMechanismDriver)
191
+        self.assertIsInstance(mech_driver, mechanism_test.TestMechanismDriver)
192 192
 
193 193
     def test_mechanism_driver_by_agent_type_not_found(self):
194 194
         self.agents = plugin.PlacementReporterAgents(ml2_plugin=self.plugin)

Loading…
Cancel
Save