summaryrefslogtreecommitdiff
path: root/tests/helpers/python/frrtest.py
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-04-04 18:34:08 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-04-04 19:01:47 +0200
commit3e7c8d040ce092d42b485cb45461af575a99e39e (patch)
tree20ddb4bf5d39b348041af75b7102623e4f0d29c2 /tests/helpers/python/frrtest.py
parente5fd248c254463830f96eb35d8ea60385ab226c0 (diff)
parent3e71b5d907e9a58049e188cd88ad86614c5ad4f6 (diff)
Merge branch 'stable/2.0'
Fixed minor conflicts from "defaults" change on stable. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'tests/helpers/python/frrtest.py')
-rw-r--r--tests/helpers/python/frrtest.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/helpers/python/frrtest.py b/tests/helpers/python/frrtest.py
index 20c854f66c..a7ef1c56b7 100644
--- a/tests/helpers/python/frrtest.py
+++ b/tests/helpers/python/frrtest.py
@@ -4,7 +4,7 @@
# Copyright (C) 2017 by David Lamparter & Christian Franke,
# Open Source Routing / NetDEF Inc.
#
-# This file is part of FreeRangeRouting (FRR)
+# This file is part of FRRouting (FRR)
#
# FRR is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -27,6 +27,7 @@ import sys
import re
import inspect
import os
+import difflib
import frrsix
@@ -154,7 +155,18 @@ class TestMultiOut(_TestMultiOut):
#
class TestRefMismatch(Exception):
- pass
+ def __init__(self, _test, outtext, reftext):
+ self.outtext = outtext.decode('utf8') if type(outtext) is bytes else outtext
+ self.reftext = reftext.decode('utf8') if type(reftext) is bytes else reftext
+
+ def __str__(self):
+ rv = 'Expected output and actual output differ:\n'
+ rv += '\n'.join(difflib.unified_diff(self.reftext.splitlines(),
+ self.outtext.splitlines(),
+ 'outtext', 'reftext',
+ lineterm=''))
+ return rv
+
class TestExitNonzero(Exception):
pass