From 8bccb4278a1c6cb291a9635a4b2252372f074b7e Mon Sep 17 00:00:00 2001 From: Carl Baldwin Date: Mon, 29 Oct 2018 20:01:39 +0000 Subject: 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. --- test/scenario_test/zapi_v3_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/scenario_test/zapi_v3_test.py') diff --git a/test/scenario_test/zapi_v3_test.py b/test/scenario_test/zapi_v3_test.py index 09c73329..b312e876 100644 --- a/test/scenario_test/zapi_v3_test.py +++ b/test/scenario_test/zapi_v3_test.py @@ -86,12 +86,12 @@ class GoBGPTestBase(unittest.TestCase): time.sleep(2) lines = self.g2.local("ip netns exec ns01 ip r", capture=True).split('\n') - self.assertTrue(len(lines) == 1) - self.assertTrue(lines[0].split(' ')[0] == '10.0.0.0/24') + self.assertEqual(len(lines), 1) + self.assertEqual(lines[0].split(' ')[0], '10.0.0.0/24') lines = self.g2.local("ip netns exec ns02 ip r", capture=True).split('\n') - self.assertTrue(len(lines) == 1) - self.assertTrue(lines[0].split(' ')[0] == '20.0.0.0/24') + self.assertEqual(len(lines), 1) + self.assertEqual(lines[0].split(' ')[0], '20.0.0.0/24') if __name__ == '__main__': -- cgit v1.2.3