diff options
Diffstat (limited to 'test/scenario_test/vrf_neighbor_test.py')
-rw-r--r-- | test/scenario_test/vrf_neighbor_test.py | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/test/scenario_test/vrf_neighbor_test.py b/test/scenario_test/vrf_neighbor_test.py index f0c6de70..333b14f6 100644 --- a/test/scenario_test/vrf_neighbor_test.py +++ b/test/scenario_test/vrf_neighbor_test.py @@ -118,28 +118,28 @@ class GoBGPTestBase(unittest.TestCase): time.sleep(1) dst = self.g2.get_global_rib('10.0.0.0/24') - self.assertTrue(len(dst) == 1) - self.assertTrue(len(dst[0]['paths']) == 1) + self.assertEqual(len(dst), 1) + self.assertEqual(len(dst[0]['paths']), 1) path = dst[0]['paths'][0] - self.assertTrue([self.g4.asn, self.g1.asn] == path['aspath']) + self.assertEqual([self.g4.asn, self.g1.asn], path['aspath']) dst = self.g3.get_global_rib('10.0.0.0/24') - self.assertTrue(len(dst) == 0) + self.assertEqual(len(dst), 0) dst = self.g4.get_global_rib(rf='vpnv4') - self.assertTrue(len(dst) == 1) - self.assertTrue(len(dst[0]['paths']) == 1) + self.assertEqual(len(dst), 1) + self.assertEqual(len(dst[0]['paths']), 1) path = dst[0]['paths'][0] - self.assertTrue([self.g1.asn] == path['aspath']) + self.assertEqual([self.g1.asn], path['aspath']) dst = self.g6.get_global_rib('10.0.0.0/24') - self.assertTrue(len(dst) == 1) - self.assertTrue(len(dst[0]['paths']) == 1) + self.assertEqual(len(dst), 1) + self.assertEqual(len(dst[0]['paths']), 1) path = dst[0]['paths'][0] - self.assertTrue([self.g5.asn, self.g4.asn, self.g1.asn] == path['aspath']) + self.assertEqual([self.g5.asn, self.g4.asn, self.g1.asn], path['aspath']) dst = self.g7.get_global_rib('10.0.0.0/24') - self.assertTrue(len(dst) == 0) + self.assertEqual(len(dst), 0) def test_03_inject_from_vrf_blue(self): self.g3.local('gobgp global rib add 10.0.0.0/24') @@ -147,25 +147,25 @@ class GoBGPTestBase(unittest.TestCase): time.sleep(1) dst = self.g2.get_global_rib('10.0.0.0/24') - self.assertTrue(len(dst) == 1) - self.assertTrue(len(dst[0]['paths']) == 1) + self.assertEqual(len(dst), 1) + self.assertEqual(len(dst[0]['paths']), 1) path = dst[0]['paths'][0] - self.assertTrue([self.g4.asn, self.g1.asn] == path['aspath']) + self.assertEqual([self.g4.asn, self.g1.asn], path['aspath']) dst = self.g4.get_global_rib(rf='vpnv4') - self.assertTrue(len(dst) == 2) + self.assertEqual(len(dst), 2) dst = self.g6.get_global_rib('10.0.0.0/24') - self.assertTrue(len(dst) == 1) - self.assertTrue(len(dst[0]['paths']) == 1) + self.assertEqual(len(dst), 1) + self.assertEqual(len(dst[0]['paths']), 1) path = dst[0]['paths'][0] - self.assertTrue([self.g5.asn, self.g4.asn, self.g1.asn] == path['aspath']) + self.assertEqual([self.g5.asn, self.g4.asn, self.g1.asn], path['aspath']) dst = self.g7.get_global_rib('10.0.0.0/24') - self.assertTrue(len(dst) == 1) - self.assertTrue(len(dst[0]['paths']) == 1) + self.assertEqual(len(dst), 1) + self.assertEqual(len(dst[0]['paths']), 1) path = dst[0]['paths'][0] - self.assertTrue([self.g5.asn, self.g4.asn, self.g3.asn] == path['aspath']) + self.assertEqual([self.g5.asn, self.g4.asn, self.g3.asn], path['aspath']) if __name__ == '__main__': |