python: be more robust to different graphviz version in tests

* wrap/python/tests/ipnbdoctest.py: Ignore anything that look like an
SVG coordinate to compare outputs.
This commit is contained in:
Alexandre Duret-Lutz 2015-03-11 23:43:27 +01:00
parent 1ffdd57383
commit 127b77fb25

View file

@ -67,6 +67,13 @@ def sanitize(s):
# normalize UUIDs: # normalize UUIDs:
s = re.sub(r'[a-f0-9]{8}(\-[a-f0-9]{4}){3}\-[a-f0-9]{12}', 'U-U-I-D', s) s = re.sub(r'[a-f0-9]{8}(\-[a-f0-9]{4}){3}\-[a-f0-9]{12}', 'U-U-I-D', s)
# SVG generated by graphviz may put note at different positions
# depending on the graphviz build. Let's just strip anything that
# look like a position.
s = re.sub(r'<path d="[^"]*"', '<path', s)
s = re.sub(r'x="[0-9.]+"', 'x=""', s)
s = re.sub(r'y="[0-9.]+"', 'y=""', s)
return s return s