]> granicus.if.org Git - graphviz/commitdiff
add a test case for #2270
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 4 Sep 2022 18:43:38 +0000 (11:43 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 4 Sep 2022 18:43:38 +0000 (11:43 -0700)
tests/test_regression.py

index 5f73a04da040bfc0fcdd8a49e4b330fd85456850..e3fcf59449fe1316c5caf066a66f04d803d460e1 100644 (file)
@@ -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"