diff options
author | Martin Winter <mwinter@opensourcerouting.org> | 2017-05-31 04:39:21 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-11-28 02:22:11 +0100 |
commit | 17070436a3701489c3c33bbe3bbefb0a63afbd0d (patch) | |
tree | aedc8297ab0280394de06dff673bf2c5eec5b34f /tests/topotests/ripng-topo1 | |
parent | lib: Move AddressSanitizer check to separate procedure and add check for erro... (diff) | |
download | frr-17070436a3701489c3c33bbe3bbefb0a63afbd0d.tar.xz frr-17070436a3701489c3c33bbe3bbefb0a63afbd0d.zip |
lib: cleanup diff text output formatting issue and move to library
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
Diffstat (limited to 'tests/topotests/ripng-topo1')
-rwxr-xr-x | tests/topotests/ripng-topo1/test_ripng_topo1.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/topotests/ripng-topo1/test_ripng_topo1.py b/tests/topotests/ripng-topo1/test_ripng_topo1.py index e790808e3..518f4e13e 100755 --- a/tests/topotests/ripng-topo1/test_ripng_topo1.py +++ b/tests/topotests/ripng-topo1/test_ripng_topo1.py @@ -30,7 +30,6 @@ test_ripng_topo1.py: Test of RIPng Topology import os import re import sys -import difflib import pytest import unicodedata from time import sleep @@ -216,9 +215,9 @@ def test_ripng_status(): actual = ('\n'.join(actual.splitlines()) + '\n').splitlines(1) # Generate Diff - diff = ''.join(difflib.context_diff(actual, expected, - fromfile="actual IPv6 RIPng status", - tofile="expected IPv6 RIPng status")) + diff = topotest.get_textdiff(actual, expected, + title1="actual IPv6 RIPng status", + title2="expected IPv6 RIPng status") # Empty string if it matches, otherwise diff contains unified diff if diff: @@ -273,9 +272,9 @@ def test_ripng_routes(): actual = ('\n'.join(actual.splitlines()) + '\n').splitlines(1) # Generate Diff - diff = ''.join(difflib.context_diff(actual, expected, - fromfile="actual SHOW IPv6 RIPng", - tofile="expected SHOW IPv6 RIPng")) + diff = topotest.get_textdiff(actual, expected, + title1="actual SHOW IPv6 RIPng", + title2="expected SHOW IPv6 RIPng") # Empty string if it matches, otherwise diff contains unified diff if diff: @@ -327,9 +326,9 @@ def test_zebra_ipv6_routingTable(): actual = ('\n'.join(actual.splitlines()) + '\n').splitlines(1) # Generate Diff - diff = ''.join(difflib.context_diff(actual, expected, - fromfile="actual Zebra IPv6 routing table", - tofile="expected Zebra IPv6 routing table")) + diff = topotest.get_textdiff(actual, expected, + title1="actual Zebra IPv6 routing table", + title2="expected Zebra IPv6 routing table") # Empty string if it matches, otherwise diff contains unified diff if diff: |