Skip to content

Commit 009bc46

Browse files
committed
Improve the test for documentation_of about the old-style absolute paths
1 parent 0137ff3 commit 009bc46

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_docs.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@ def test_documentation_of(self) -> None:
2525
get_random_string = lambda: ''.join([random.choice('0123456789abcdef') for _ in range(64)])
2626
random_relative_hpp = get_random_string()
2727
random_absolute_hpp = get_random_string()
28+
random_unsupported_absolute_hpp = get_random_string()
2829
random_no_document_hpp = get_random_string()
2930
random_relative_md = get_random_string()
3031
random_absolute_md = get_random_string()
32+
random_unsupported_absolute_md = get_random_string()
3133
random_standalone_page_md = get_random_string()
3234

3335
files = {
3436
pathlib.Path('src', 'a', 'b', 'relative.hpp'): random_relative_hpp.encode(),
3537
pathlib.Path('src', 'a', 'b', 'absolute.hpp'): random_absolute_hpp.encode(),
38+
pathlib.Path('src', 'a', 'b', 'unsupported-absolute.hpp'): random_unsupported_absolute_hpp.encode(),
3639
pathlib.Path('src', 'a', 'b', 'no-document.hpp'): random_no_document_hpp.encode(),
3740
pathlib.Path('docs', 'x', 'y', 'relative.md'): textwrap.dedent(f"""\
3841
---
@@ -42,6 +45,14 @@ def test_documentation_of(self) -> None:
4245
4346
{random_relative_md}
4447
""").encode(),
48+
pathlib.Path('docs', 'x', 'y', 'unsupported-absolute.md'): textwrap.dedent(f"""\
49+
---
50+
title: unsupported-absolute.md
51+
documentation_of: src/a/b/unsupported-absolute.hpp
52+
---
53+
54+
{random_unsupported_absolute_md}
55+
""").encode(),
4556
pathlib.Path('docs', 'x', 'y', 'absolute.md'): textwrap.dedent(f"""\
4657
---
4758
title: absolute.md
@@ -63,6 +74,7 @@ def test_documentation_of(self) -> None:
6374
expected: Dict[pathlib.Path, List[str]] = {
6475
destination_dir / 'src' / 'a' / 'b' / 'relative.hpp.md': [random_relative_hpp, random_relative_md],
6576
destination_dir / 'src' / 'a' / 'b' / 'absolute.hpp.md': [random_absolute_hpp, random_absolute_md],
77+
destination_dir / 'src' / 'a' / 'b' / 'unsupported-absolute.hpp.md': [random_unsupported_absolute_hpp, random_unsupported_absolute_md],
6678
destination_dir / 'src' / 'a' / 'b' / 'no-document.hpp.md': [random_no_document_hpp],
6779
destination_dir / 'docs' / 'x' / 'y' / 'standalone-page.md': [random_standalone_page_md],
6880
}

0 commit comments

Comments
 (0)