cli: add messages to assertTrue
1) Unify assertion of 'usage: service-name' from
{cinder, glance, keystone, neutron} help tests
into assertFirstLineStartsWith method, which provides
more usefull failure message.
2) Add failure message to assertTrue in keystone-catalog
test.
Change-Id: I3abba1d9509bee649aa1675beee4153341b1e170
diff --git a/tempest/cli/__init__.py b/tempest/cli/__init__.py
index b34d516..08f585a 100644
--- a/tempest/cli/__init__.py
+++ b/tempest/cli/__init__.py
@@ -134,6 +134,11 @@
for field in field_names:
self.assertIn(field, item)
+ def assertFirstLineStartsWith(self, lines, beginning):
+ self.assertTrue(lines[0].startswith(beginning),
+ msg=('Beginning of first line has invalid content: %s'
+ % lines[:3]))
+
class CommandFailed(subprocess.CalledProcessError):
# adds output attribute for python2.6