From a05385c7a177208d71eeefba0c1d26512f086c88 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Mon, 6 May 2024 16:27:09 +0200 Subject: [PATCH] Fix failures pointed by the flake8 run by the pre-commit script TrivialFix Change-Id: I7b36913a2b41938df0c737291ed7268f853d6a65 (cherry picked from commit 2afbb65a517a67734ec682ab9dffbb65accfb72d) --- .../drivers/openstack/test_ovn_stretched_l2_bgp_driver.py | 8 ++++---- .../tests/unit/drivers/openstack/utils/test_ovn.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ovn_bgp_agent/tests/unit/drivers/openstack/test_ovn_stretched_l2_bgp_driver.py b/ovn_bgp_agent/tests/unit/drivers/openstack/test_ovn_stretched_l2_bgp_driver.py index 787882a4..896d4ace 100644 --- a/ovn_bgp_agent/tests/unit/drivers/openstack/test_ovn_stretched_l2_bgp_driver.py +++ b/ovn_bgp_agent/tests/unit/drivers/openstack/test_ovn_stretched_l2_bgp_driver.py @@ -44,8 +44,8 @@ class TestHashedRoute(test_base.TestCase): self.table.add(self.route) def test_lookup(self): - self.assertTrue(self.route in self.table) - self.assertFalse(self.invalid_route in self.table) + self.assertIn(self.route, self.table) + self.assertNotIn(self.invalid_route, self.table) def test_delete(self): self.table.remove(self.route) @@ -214,7 +214,7 @@ class TestOVNBGPStretchedL2Driver(test_base.TestCase): via=test_route.dst, ) - self.assertTrue(test_route in self.bgp_driver.vrf_routes) + self.assertIn(test_route, self.bgp_driver.vrf_routes) @mock.patch.object(linux_net, "del_ip_route") def test__del_route(self, mock_del_route): @@ -237,7 +237,7 @@ class TestOVNBGPStretchedL2Driver(test_base.TestCase): via=test_route.dst, ) - self.assertTrue(test_route not in self.bgp_driver.vrf_routes) + self.assertNotIn(test_route, self.bgp_driver.vrf_routes) def test__address_scope_allowed(self): test_scope2 = { diff --git a/ovn_bgp_agent/tests/unit/drivers/openstack/utils/test_ovn.py b/ovn_bgp_agent/tests/unit/drivers/openstack/utils/test_ovn.py index 56c00a7e..2a6a3dec 100644 --- a/ovn_bgp_agent/tests/unit/drivers/openstack/utils/test_ovn.py +++ b/ovn_bgp_agent/tests/unit/drivers/openstack/utils/test_ovn.py @@ -457,7 +457,7 @@ class TestOvsdbSbOvnIdl(test_base.TestCase): 'tag': tag}) m_dp.return_value = [row, ] net_name, net_tag = self.sb_idl.get_network_name_and_tag( - 'fake-dp', 'br-ex:public'.format(network)) + 'fake-dp', 'br-ex:public') if network_in_bridge_map: self.assertEqual(network, net_name)