Skip to content

Commit 5450323

Browse files
committed
Update testing to cover operator description update
1 parent f4cefc2 commit 5450323

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

tests/test_documentation.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@ def test_generate_operators_doc(tmp_path: Path):
3434
assert file_to_test.exists()
3535

3636

37-
def test_generate_operators_doc_plugin(tmp_path: Path):
37+
def test_generate_operators_doc_plugin_and_update(tmp_path: Path):
38+
specs_path = tmp_path / "operator-specifications"
39+
specs_path.mkdir()
40+
utility_path = specs_path / "utility"
41+
utility_path.mkdir()
42+
forward_update_path = utility_path / "forward_upd.md"
43+
test_string = r"""## Description
44+
45+
Test update"""
46+
with forward_update_path.open(mode="w", encoding="utf-8") as ff:
47+
ff.write(test_string)
3848
generate_operators_doc(
3949
ansys_path=dpf.SERVER.ansys_path,
4050
output_path=tmp_path,
@@ -43,5 +53,8 @@ def test_generate_operators_doc_plugin(tmp_path: Path):
4353
)
4454
file_to_test = tmp_path / "toc.yml"
4555
assert file_to_test.exists()
46-
file_to_test = tmp_path / "operator-specifications" / "utility" / "forward.md"
56+
file_to_test = utility_path / "forward.md"
4757
assert file_to_test.exists()
58+
with file_to_test.open(mode="r", encoding="utf-8") as ff:
59+
text = ff.read()
60+
assert test_string in text

0 commit comments

Comments
 (0)