Commit e381c05b by Łukasz Nowak Committed by Łukasz Nowak

caddy-frontend/test: Allow extended msg in assertTestData

1 parent 1e7ef8e1
......@@ -273,7 +273,7 @@ class TestDataMixin(object):
'%(group)s:%(name)s %(statename)s' % q for q
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')
test_data_file = os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'test_data', filename)
......@@ -288,10 +288,13 @@ class TestDataMixin(object):
maxDiff = self.maxDiff
self.maxDiff = None
longMessage = self.longMessage
self.longMessage = True
try:
self.assertMultiLineEqual(
test_data,
runtime_data
runtime_data,
msg=msg
)
except AssertionError:
if os.environ.get('SAVE_TEST_DATA', '0') == '1':
......@@ -299,6 +302,7 @@ class TestDataMixin(object):
raise
finally:
self.maxDiff = maxDiff
self.longMessage = longMessage
def _test_file_list(self, slave_dir, IGNORE_PATH_LIST):
runtime_data = []
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!