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/route_server_test2.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/route_server_test2.py')
-rw-r--r-- | test/scenario_test/route_server_test2.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/scenario_test/route_server_test2.py b/test/scenario_test/route_server_test2.py index 3bbfeada..82c0656f 100644 --- a/test/scenario_test/route_server_test2.py +++ b/test/scenario_test/route_server_test2.py @@ -81,8 +81,8 @@ class GoBGPTestBase(unittest.TestCase): def test_03_check_neighbor_rib(self): rib = self.gobgp.get_local_rib(self.clients['e2']) - self.assertTrue(len(rib) == 1) - self.assertTrue(len(rib[0]['paths']) == 1) + self.assertEqual(len(rib), 1) + self.assertEqual(len(rib[0]['paths']), 1) path = rib[0]['paths'][0] self.assertTrue(65001 not in path['aspath']) @@ -90,9 +90,9 @@ class GoBGPTestBase(unittest.TestCase): self.clients['g2'].local('gobgp global rib del 10.0.0.0/24') time.sleep(1) s = self.gobgp.get_neighbor(self.clients['g2'])['state'] - self.assertTrue(s.get('advertised', 0) == 1) - self.assertTrue(s.get('accepted') == None) # means info['accepted'] == 0 - self.assertTrue(s.get('received') == None) # means info['received'] == 0 + self.assertEqual(s.get('advertised', 0), 1) + self.assertEqual(s.get('accepted'), None) # means info['accepted'] == 0 + self.assertEqual(s.get('received'), None) # means info['received'] == 0 if __name__ == '__main__': |