From bd92c25ac3e1c173f085f4bf502bed372d281e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Eckl?= Date: Thu, 17 May 2018 09:37:02 +0200 Subject: tests: py: Make diff functions use print_* functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Máté Eckl Signed-off-by: Florian Westphal --- tests/py/nft-test.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py index b536e9cd..edc0b4b1 100755 --- a/tests/py/nft-test.py +++ b/tests/py/nft-test.py @@ -161,15 +161,13 @@ def color_differences(rule, other, color): def print_differences_warning(filename, lineno, rule1, rule2, cmd): colored_rule1 = color_differences(rule1, rule2, Colors.YELLOW) colored_rule2 = color_differences(rule2, rule1, Colors.YELLOW) - reason = "'" + colored_rule1 + "' mismatches '" + colored_rule2 + "'" - print filename + ": " + Colors.YELLOW + "WARNING: " + Colors.ENDC + \ - "line: " + str(lineno + 1) + ": '" + cmd + "': " + reason + reason = "'%s': '%s' mismatches '%s'" % (cmd, colored_rule1, colored_rule2) + print_warning(reason, filename, lineno) def print_differences_error(filename, lineno, cmd): - reason = "Listing is broken." - print filename + ": " + Colors.RED + "ERROR: " + Colors.ENDC + "line: " + \ - str(lineno + 1) + ": '" + cmd + "': " + reason + reason = "'%s': Listing is broken." % cmd + print_error(reason, filename, lineno) def table_exist(table, filename, lineno): -- cgit v1.2.3