summaryrefslogtreecommitdiffstats
path: root/test/test_p2p_ethernet.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-03-06 15:11:28 -0800
committerOle Trøan <otroan@employees.org>2019-03-11 08:09:23 +0000
commit9a6dafd569db0d0b5dc9d7b5b34b17e3f411a9ee (patch)
tree3459a0c6df3fd09548daa9c315145dd2aaf03775 /test/test_p2p_ethernet.py
parentf70cead5eb928954908de48300cc7a9c88430c0f (diff)
Tests: use self.assertNotIn().
Many tests use self.assertEqual(error.find("failed"), -1) Use self.assertNotIn("failed", error) to provide more meaningful errors such as AssertionError: 'Failed' not found in '' instead of 0 != -1. Change-Id: I670acdc977b788b2cedf94cfeafc12097781463f Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/test_p2p_ethernet.py')
-rw-r--r--test/test_p2p_ethernet.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/test_p2p_ethernet.py b/test/test_p2p_ethernet.py
index b0d546e4d1f..5200e482b04 100644
--- a/test/test_p2p_ethernet.py
+++ b/test/test_p2p_ethernet.py
@@ -48,22 +48,22 @@ class P2PEthernetAPI(VppTestCase):
self.create_p2p_ethernet(self.pg0, 2, "de:ad:00:00:00:02")
intfs = self.vapi.cli("show interface")
- self.assertNotEqual(intfs.find('pg0.1'), -1)
- self.assertNotEqual(intfs.find('pg0.2'), -1)
- self.assertEqual(intfs.find('pg0.5'), -1)
+ self.assertIn('pg0.1', intfs)
+ self.assertIn('pg0.2', intfs)
+ self.assertNotIn('pg0.5', intfs)
# create pg2.5 subif
self.create_p2p_ethernet(self.pg0, 5, "de:ad:00:00:00:ff")
intfs = self.vapi.cli("show interface")
- self.assertNotEqual(intfs.find('pg0.5'), -1)
+ self.assertIn('pg0.5', intfs)
# delete pg2.5 subif
self.delete_p2p_ethernet(self.pg0, "de:ad:00:00:00:ff")
intfs = self.vapi.cli("show interface")
- self.assertNotEqual(intfs.find('pg0.1'), -1)
- self.assertNotEqual(intfs.find('pg0.2'), -1)
- self.assertEqual(intfs.find('pg0.5'), -1)
+ self.assertIn('pg0.1', intfs)
+ self.assertIn('pg0.2', intfs)
+ self.assertNotIn('pg0.5', intfs)
self.logger.info("FFP_TEST_FINISH_0000")