From c71ecbf51592aac81cb95a48318302ca38e47028 Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Wed, 6 Mar 2024 18:38:13 +0100 Subject: [PATCH] Add test for parsing directory --- test/unit/pybind/test_parser.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/unit/pybind/test_parser.py diff --git a/test/unit/pybind/test_parser.py b/test/unit/pybind/test_parser.py new file mode 100644 index 000000000..6863a9c87 --- /dev/null +++ b/test/unit/pybind/test_parser.py @@ -0,0 +1,12 @@ +import nmodl +from pathlib import Path +import pytest + + +def test_parse_directory(): + """ + Make sure we raise an error when parsing a directory instead of a file + """ + + with pytest.raises(RuntimeError): + nmodl.NmodlDriver().parse_file(str(Path(__file__).parent))