From 75dfba9316382875e43294abf39466cf97bf1284 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Fri, 22 Oct 2021 22:36:20 +0200 Subject: [PATCH] WireViz 0.4maybe: `wireviz.parse()`'s `file_out` argument optional again --- tests/test_api.py | 2 +- wireviz_web/core.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index 2dbc6fc..2fd6a98 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -66,7 +66,7 @@ def test_html(self, client): assert response.headers["Content-Disposition"] == "attachment; filename=test.html" assert b"" in response.data assert b"""wiring-42" in response.data + assert b"WireViz diagram and BOM" in response.data assert b"

Diagram

" in response.data assert b"Bill of Materials" in response.data diff --git a/wireviz_web/core.py b/wireviz_web/core.py index b7a67d1..c5e76e1 100644 --- a/wireviz_web/core.py +++ b/wireviz_web/core.py @@ -112,11 +112,7 @@ def wireviz_render(input_yaml: str, output_mimetype: str, output_filename: str) # Parse WireViz YAML. try: - # WireViz >= 0.3 needs the `file_out` parameter. - # This will apparently be deleted by WireViz? - with TemporaryDirectory() as tmpdir: - file_out = Path(tmpdir) / "wiring-42" - harness: Harness = wireviz.parse(yaml_input=input_yaml, file_out=file_out, return_types="harness") + harness: Harness = wireviz.parse(yaml_input=input_yaml, return_types="harness") except Exception as ex: message = f"Unable to parse WireViz YAML format: {ex}" logger.exception(message)