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>
This commit is contained in:

committed by
Ole Trøan

parent
f70cead5eb
commit
9a6dafd569
@ -293,14 +293,14 @@ class TestUDP(VppTestCase):
|
||||
"uri " + uri)
|
||||
if error:
|
||||
self.logger.critical(error)
|
||||
self.assertEqual(error.find("failed"), -1)
|
||||
self.assertNotIn("failed", error)
|
||||
|
||||
error = self.vapi.cli("test echo client mbytes 10 appns 1 " +
|
||||
"fifo-size 4 no-output test-bytes " +
|
||||
"syn-timeout 2 no-return uri " + uri)
|
||||
if error:
|
||||
self.logger.critical(error)
|
||||
self.assertEqual(error.find("failed"), -1)
|
||||
self.assertNotIn("failed", error)
|
||||
|
||||
# Delete inter-table routes
|
||||
ip_t01.remove_vpp_config()
|
||||
|
Reference in New Issue
Block a user