Skip to content

Commit ee0e14f

Browse files
committed
Update test for toc.yml
1 parent 31f778a commit ee0e14f

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

tests/test_documentation.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,33 @@
2727

2828

2929
def test_generate_operators_doc(tmp_path: Path):
30+
specs_path = tmp_path / "operator-specifications"
31+
specs_path.mkdir()
32+
toc_path = tmp_path / "toc.yml"
33+
toc_string = r"""- name: Operator specifications
34+
items:
35+
36+
- name: Changelog
37+
href: changelog/changelog.md"""
38+
with toc_path.open(mode="w") as ff:
39+
ff.write(toc_string)
3040
generate_operators_doc(ansys_path=dpf.SERVER.ansys_path, output_path=tmp_path, verbose=False)
31-
file_to_test = tmp_path / "toc.yml"
32-
assert file_to_test.exists()
33-
file_to_test = tmp_path / "operator-specifications" / "utility" / "forward.md"
41+
assert toc_path.exists()
42+
file_to_test = specs_path / "utility" / "forward.md"
3443
assert file_to_test.exists()
3544

3645

3746
def test_generate_operators_doc_plugin_and_update(tmp_path: Path):
3847
specs_path = tmp_path / "operator-specifications"
3948
specs_path.mkdir()
49+
toc_path = tmp_path / "toc.yml"
50+
toc_string = r"""- name: Operator specifications
51+
items:
52+
53+
- name: Changelog
54+
href: changelog/changelog.md"""
55+
with toc_path.open(mode="w") as ff:
56+
ff.write(toc_string)
4057
utility_path = specs_path / "utility"
4158
utility_path.mkdir()
4259
forward_update_path = utility_path / "forward_upd.md"
@@ -51,8 +68,7 @@ def test_generate_operators_doc_plugin_and_update(tmp_path: Path):
5168
verbose=False,
5269
desired_plugin="core",
5370
)
54-
file_to_test = tmp_path / "toc.yml"
55-
assert file_to_test.exists()
71+
assert toc_path.exists()
5672
file_to_test = utility_path / "forward.md"
5773
assert file_to_test.exists()
5874
with file_to_test.open(mode="r", encoding="utf-8") as ff:

0 commit comments

Comments
 (0)