Skip to content
Snippets Groups Projects
Commit 5e60ee26 authored by Bob Lantz's avatar Bob Lantz
Browse files

assertTrue( a > b ) -> assertGreater( a, b ) for better messages

parent 7c29c2eb
No related branches found
No related tags found
No related merge requests found
...@@ -53,8 +53,8 @@ def assertWithinTolerance(self, measured, expected, tolerance_frac): ...@@ -53,8 +53,8 @@ def assertWithinTolerance(self, measured, expected, tolerance_frac):
"""Check that a given value is within a tolerance of expected """Check that a given value is within a tolerance of expected
tolerance_frac: less-than-1.0 value; 0.8 would yield 20% tolerance. tolerance_frac: less-than-1.0 value; 0.8 would yield 20% tolerance.
""" """
self.assertTrue( float(measured) >= float(expected) * tolerance_frac ) self.assertGreaterEqual( float(measured),
self.assertTrue( float(measured) >= float(expected) * tolerance_frac ) float(expected) * tolerance_frac )
def testCPULimits( self ): def testCPULimits( self ):
"Verify topology creation with CPU limits set for both schedulers." "Verify topology creation with CPU limits set for both schedulers."
...@@ -120,7 +120,7 @@ def testLinkLoss( self ): ...@@ -120,7 +120,7 @@ def testLinkLoss( self ):
for _ in range(REPS): for _ in range(REPS):
dropped_total += mn.ping(timeout='1') dropped_total += mn.ping(timeout='1')
mn.stop() mn.stop()
self.assertTrue(dropped_total > 0) self.assertGreater( dropped_total, 0 )
def testMostOptions( self ): def testMostOptions( self ):
"Verify topology creation with most link options and CPU limits." "Verify topology creation with most link options and CPU limits."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment