Skip to content

Commit ba7d73f

Browse files
committed
Add the config checker to check generated configs of examples
1 parent 4eb304a commit ba7d73f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tests/test_examples.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import tempfile
44
from pathlib import Path
55

6+
from preciceconfigcheck.cli import runCheck
7+
68

79
def list_examples():
810
examples = Path(__file__).parent.parent / "examples"
@@ -23,3 +25,11 @@ def test_application_with_example(example: Path):
2325
output = [p.name for p in Path(temp_dir).iterdir()]
2426
print(f"Output {output}")
2527
assert output, "Nothing generated"
28+
29+
config = Path(temp_dir) / "precice-config.xml"
30+
assert config.exists(), "No config generated"
31+
ret = runCheck(config, True)
32+
if ret != 0:
33+
print("Failed config:")
34+
print(config.read_text())
35+
assert False, "The config failed to validate"

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ description = run the tests with pytest
1010
package = wheel
1111
wheel_build_env = .pkg
1212
deps =
13+
precice-config-check
1314
pytest>=6
1415
commands =
1516
pytest {tty:--color=yes} {posargs}

0 commit comments

Comments
 (0)