diff --git a/src/ebd_toolchain/main.py b/src/ebd_toolchain/main.py index 18f5e0a..5b713e1 100644 --- a/src/ebd_toolchain/main.py +++ b/src/ebd_toolchain/main.py @@ -82,7 +82,6 @@ def _dump_svg(svg_path: Path, ebd_graph: EbdGraph, converter: DotToSvgConverter) def _dump_json(json_path: Path, ebd_table: EbdTable | EbdTableMetaData) -> None: with open(json_path, "w+", encoding="utf-8") as json_file: - json.dump(cattrs.unstructure(ebd_table), json_file, ensure_ascii=False, indent=2, sort_keys=True) if isinstance(ebd_table, EbdTableMetaData): json.dump( cattrs.unstructure(EbdTable(metadata=ebd_table, rows=[])), diff --git a/unittests/test_main.py b/unittests/test_main.py index e0d0988..6c02ac2 100644 --- a/unittests/test_main.py +++ b/unittests/test_main.py @@ -2,6 +2,7 @@ tests the main script """ +import json from pathlib import Path from typing import Literal @@ -37,3 +38,8 @@ def test_main( # in the repo root _main(input_path, tmp_path, export_types) # we don't assert on the results but instead just check that it doesn't crash + json_files = list(tmp_path.glob("*.json")) + for json_file in json_files: + assert json_file.exists() + with open(json_file, "r", encoding="utf-8") as f: + _ = json.load(f) # must be valid json