From 7d236d796ef6c802bf062650a1b53e947fab9164 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 14 Feb 2021 09:43:25 -0800 Subject: [PATCH] add a test of user shapes --- rtest/test_regression.py | 17 +++++++++++++++++ rtest/usershape.dot | 3 +++ rtest/usershape.svg | 18 ++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 rtest/usershape.dot create mode 100644 rtest/usershape.svg diff --git a/rtest/test_regression.py b/rtest/test_regression.py index e60fde08b..9f5c8f6cb 100644 --- a/rtest/test_regression.py +++ b/rtest/test_regression.py @@ -749,3 +749,20 @@ def test_package_version(): # run the test subprocess.check_call([exe]) + +def test_user_shapes(): + ''' + Graphviz should understand how to embed a custom SVG image as a node’s shape + ''' + + # find our collocated test case + input = Path(__file__).parent / 'usershape.dot' + assert input.exists(), 'unexpectedly missing test case' + + # ask Graphviz to translate this to SVG + output = subprocess.check_output(['dot', '-Tsvg', input], + cwd=os.path.dirname(__file__), universal_newlines=True) + + # the external SVG should have been parsed and is now referenced + assert ' + + + + + +G + + + +a + + + + -- 2.40.0