Use assertGreater(len(x), 0) instead of assertTrue(len(x) > 0)
assertGreater provides a nicer error message if it fails. Change-Id: Id9a2e11e21cca87bb4ef23ced5bbbae6817dba73
This commit is contained in:
parent
f54339f316
commit
f8851fbdd6
@ -1098,7 +1098,7 @@ class VolumeViewTests(test.ResetImageAPIVersionMixin, test.TestCase):
|
||||
|
||||
matching = list(moves.filter(lambda r: _matches_row_id(r),
|
||||
res.context))
|
||||
self.assertTrue(len(matching) > 1,
|
||||
self.assertGreater(len(matching), 1,
|
||||
"Expected at least one row matching %s" % row_id)
|
||||
row = matching[-1].dicts[1]
|
||||
matching_actions = list(moves.filter(lambda a: a.name == action_name,
|
||||
|
@ -38,7 +38,7 @@ class TestDefaults(helpers.AdminTestCase):
|
||||
self.assertFalse(
|
||||
self.defaults_page.find_message_and_dismiss(messages.ERROR))
|
||||
|
||||
self.assertTrue(len(default_quota_values) > 0)
|
||||
self.assertGreater(len(default_quota_values), 0)
|
||||
|
||||
for quota_name in default_quota_values:
|
||||
self.assertTrue(
|
||||
|
@ -20,4 +20,4 @@ class BrowserTests(test.SeleniumTestCase):
|
||||
self.selenium.get(self.live_server_url)
|
||||
button = self.selenium.find_element_by_id("loginBtn")
|
||||
# Ensure button has something; must be language independent.
|
||||
self.assertTrue(len(button.text) > 0)
|
||||
self.assertGreater(len(button.text), 0)
|
||||
|
Loading…
Reference in New Issue
Block a user