From: Matthew Fernandez Date: Sun, 4 Sep 2022 18:43:38 +0000 (-0700) Subject: add a test case for #2270 X-Git-Tag: 6.0.1~12^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e13a98c7e4828dbe7fd5ed2dd2321c47e65f381;p=graphviz add a test case for #2270 --- diff --git a/tests/test_regression.py b/tests/test_regression.py index 5f73a04da..e3fcf5944 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -1951,3 +1951,22 @@ def test_2258(): for gradient in gradients: assert "G2" in gradient.get("id"), "ID was not applied to linear gradients" + +@pytest.mark.xfail(strict=True) +def test_2270(tmp_path: Path): + """ + `-O` should result in the expected output filename + https://gitlab.com/graphviz/graphviz/-/issues/2270 + """ + + # write a simple graph + input = tmp_path / "hello.gv" + input.write_text("digraph { hello -> world }", encoding="utf-8") + + # process it with Graphviz + subprocess.check_call(["dot", "-T", "plain:dot:core", "-O", "hello.gv"], + cwd=tmp_path) + + # it should have produced output in the expected location + output = tmp_path / "hello.gv.core.dot.plain" + assert output.exists(), "-O resulted in an unexpected output filename"