Use assertGreater(len(x), y) instead of assertTrue(len(x) > y)

assertGreater provides a nicer error message if it fails.

Change-Id: I13aecd5ecd2ecb94e6a2e8a01f8607277f6fe29d
This commit is contained in:
Cady_Chen 2016-12-19 23:06:04 +08:00
parent 14079d0f21
commit 559b3a9c67
1 changed files with 1 additions and 1 deletions

View File

@ -458,7 +458,7 @@ class L3AgentTestFramework(base.BaseSudoTestCase):
def _assert_internal_devices(self, router):
internal_devices = router.router[constants.INTERFACE_KEY]
self.assertTrue(len(internal_devices))
self.assertGreater(len(internal_devices), 0)
for device in internal_devices:
self.assertTrue(self.device_exists_with_ips_and_mac(
device, router.get_internal_device_name, router.ns_name))