diff options
author | Carl Baldwin <carl@ecbaldwin.net> | 2018-10-29 20:01:39 +0000 |
---|---|---|
committer | Carl Baldwin <carl@ecbaldwin.net> | 2018-10-29 20:10:19 +0000 |
commit | 8bccb4278a1c6cb291a9635a4b2252372f074b7e (patch) | |
tree | d1f9d1061a1db670fea7af527e10add4a2b09e59 /test/scenario_test/zapi_v3_test.py | |
parent | c8694bc8a7dccd663689f8d134b89fe3a1f37d70 (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/zapi_v3_test.py')
-rw-r--r-- | test/scenario_test/zapi_v3_test.py | 8 |
1 files changed, 4 insertions, 4 deletions
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__': |