Move cli asserts to test class
This commit moves the cli test specific asserts into the test class. Previously, they were added to the client class as part of the refactor into library. When the test class was added again these methods weren't added back.
This commit is contained in:
@@ -180,17 +180,6 @@ class CLIClientBase(object):
|
||||
return execute(cmd, action, flags, params, fail_ok, merge_stderr,
|
||||
self.cli_dir)
|
||||
|
||||
def assertTableStruct(self, items, field_names):
|
||||
"""Verify that all items has keys listed in field_names."""
|
||||
for item in items:
|
||||
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 ClientTestBase(base.BaseTestCase):
|
||||
|
||||
@@ -201,3 +190,14 @@ class ClientTestBase(base.BaseTestCase):
|
||||
|
||||
def _get_clients(self):
|
||||
raise NotImplementedError
|
||||
|
||||
def assertTableStruct(self, items, field_names):
|
||||
"""Verify that all items has keys listed in field_names."""
|
||||
for item in items:
|
||||
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]))
|
||||
|
Reference in New Issue
Block a user