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

assertGreater provides a nicer error message if it fails.

Change-Id: I37da4d5cb6d41ab7fdef4900862352dbc498f433
This commit is contained in:
Cady_Chen 2016-12-17 21:27:55 +08:00
parent 367f195a64
commit 1fdb9516c5

View File

@ -397,7 +397,7 @@ class TaskTestCase(unittest.TestCase):
for line in res.splitlines():
if "finished" in line:
task_uuids.append(line.split(" ")[1][:-1])
self.assertTrue(len(task_uuids))
self.assertGreater(len(task_uuids), 0)
self.assertIn(task_uuids[0],
rally("task list --uuids-only --deployment MAIN"))