topotests: Update json_cmp_result to return readable result

Before this update, json_cmp_results which were formatted as strings
would not show the error mesage but just an object reference.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
This commit is contained in:
Christian Franke 2018-12-04 16:11:41 +01:00
parent 32bc1eafb6
commit 7fe06d5559

View File

@ -60,6 +60,9 @@ class json_cmp_result(object):
"Returns True if there were errors, otherwise False." "Returns True if there were errors, otherwise False."
return len(self.errors) > 0 return len(self.errors) > 0
def __str__(self):
return '\n'.join(self.errors)
def get_test_logdir(node=None, init=False): def get_test_logdir(node=None, init=False):
""" """
Return the current test log directory based on PYTEST_CURRENT_TEST Return the current test log directory based on PYTEST_CURRENT_TEST