summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/route_server_ipv4_v6_test.py
diff options
context:
space:
mode:
authorCarl Baldwin <carl@ecbaldwin.net>2018-10-29 20:01:39 +0000
committerCarl Baldwin <carl@ecbaldwin.net>2018-10-29 20:10:19 +0000
commit8bccb4278a1c6cb291a9635a4b2252372f074b7e (patch)
treed1f9d1061a1db670fea7af527e10add4a2b09e59 /test/scenario_test/route_server_ipv4_v6_test.py
parentc8694bc8a7dccd663689f8d134b89fe3a1f37d70 (diff)
Use assertEqual in python tests
In trying to run the local tests, I found that changing these assertTrue calls to assertEqual helped me out. With this, a failure shows the actual and expected values rather than just saying "True is not False" which is less helpful.
Diffstat (limited to 'test/scenario_test/route_server_ipv4_v6_test.py')
-rw-r--r--test/scenario_test/route_server_ipv4_v6_test.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/scenario_test/route_server_ipv4_v6_test.py b/test/scenario_test/route_server_ipv4_v6_test.py
index ce17e18c..28b438d2 100644
--- a/test/scenario_test/route_server_ipv4_v6_test.py
+++ b/test/scenario_test/route_server_ipv4_v6_test.py
@@ -91,7 +91,7 @@ class GoBGPIPv6Test(unittest.TestCase):
time.sleep(self.wait_per_retry)
continue
- self.assertTrue(len(local_rib) == (len(ctns) - 1))
+ self.assertEqual(len(local_rib), (len(ctns) - 1))
for c in ctns.itervalues():
if rs_client != c:
@@ -116,7 +116,7 @@ class GoBGPIPv6Test(unittest.TestCase):
time.sleep(self.wait_per_retry)
continue
- self.assertTrue(len(global_rib) == len(ctns))
+ self.assertEqual(len(global_rib), len(ctns))
for c in ctns.itervalues():
for r in c.routes:
@@ -159,12 +159,12 @@ class GoBGPIPv6Test(unittest.TestCase):
def test_08_check_rib(self):
for q in self.ipv4s.itervalues():
- self.assertTrue(len(self.gobgp.get_adj_rib_out(q)) == 0)
- self.assertTrue(len(q.get_global_rib()) == len(q.routes))
+ self.assertEqual(len(self.gobgp.get_adj_rib_out(q)), 0)
+ self.assertEqual(len(q.get_global_rib()), len(q.routes))
for q in self.ipv6s.itervalues():
- self.assertTrue(len(self.gobgp.get_adj_rib_out(q, rf='ipv6')) == 0)
- self.assertTrue(len(q.get_global_rib(rf='ipv6')) == len(q.routes))
+ self.assertEqual(len(self.gobgp.get_adj_rib_out(q, rf='ipv6')), 0)
+ self.assertEqual(len(q.get_global_rib(rf='ipv6')), len(q.routes))
if __name__ == '__main__':