Commit c9f91fbe authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend/test: Allow extended msg in assertTestData

parent 4384cd61
...@@ -273,7 +273,7 @@ class TestDataMixin(object): ...@@ -273,7 +273,7 @@ class TestDataMixin(object):
'%(group)s:%(name)s %(statename)s' % q for q '%(group)s:%(name)s %(statename)s' % q for q
in self.getSupervisorRPCServer().supervisor.getAllProcessInfo()])) in self.getSupervisorRPCServer().supervisor.getAllProcessInfo()]))
def assertTestData(self, runtime_data, hash_value=None): def assertTestData(self, runtime_data, hash_value=None, msg=None):
filename = '%s-%s.txt' % (self.id(), 'CADDY') filename = '%s-%s.txt' % (self.id(), 'CADDY')
test_data_file = os.path.join( test_data_file = os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'test_data', filename) os.path.dirname(os.path.realpath(__file__)), 'test_data', filename)
...@@ -288,10 +288,13 @@ class TestDataMixin(object): ...@@ -288,10 +288,13 @@ class TestDataMixin(object):
maxDiff = self.maxDiff maxDiff = self.maxDiff
self.maxDiff = None self.maxDiff = None
longMessage = self.longMessage
self.longMessage = True
try: try:
self.assertMultiLineEqual( self.assertMultiLineEqual(
test_data, test_data,
runtime_data runtime_data,
msg=msg
) )
except AssertionError: except AssertionError:
if os.environ.get('SAVE_TEST_DATA', '0') == '1': if os.environ.get('SAVE_TEST_DATA', '0') == '1':
...@@ -299,6 +302,7 @@ class TestDataMixin(object): ...@@ -299,6 +302,7 @@ class TestDataMixin(object):
raise raise
finally: finally:
self.maxDiff = maxDiff self.maxDiff = maxDiff
self.longMessage = longMessage
def _test_file_list(self, slave_dir, IGNORE_PATH_LIST): def _test_file_list(self, slave_dir, IGNORE_PATH_LIST):
runtime_data = [] runtime_data = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment