Skip to content

Commit

Permalink
i said everything
Browse files Browse the repository at this point in the history
  • Loading branch information
Walavouchey committed Nov 30, 2023
1 parent 017db31 commit 53a3793
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/test_link_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,13 +510,15 @@ def test__github_link_invalid(self, root, payload):
[
{"string": "This link is [ok](https://github.com/ppy/osu-wiki/blob/master/wiki/Another_article/en.md).", "resolved_location": "wiki/Another_article/en.md"},
{"string": "This link is [also ok](https://github.com/ppy/osu-wiki/tree/master/wiki/Another_article).", "resolved_location": "wiki/Another_article"},
{"string": "This link is [very ok](https://github.com/ppy/osu-wiki/tree/master/news).", "resolved_location": "news"},
{"string": "This link is [another ok link](https://github.com/ppy/osu-wiki/tree/master/README.md).", "resolved_location": "README.md"},
]
)
def test__github_link_valid(self, root, payload):
utils.create_files(
root,
('wiki/Another_article/en.md', '# Another article'),
('news/2023/newspost.md', '# news post'),
('README.md', '# Please read me')
)

Expand Down
2 changes: 1 addition & 1 deletion wikitools/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def exists_case_insensitive(path: pathlib.Path) -> bool:
# case-insensitive directory/file existence checking isn't trivial in case-sensitive file systems because os-provided existence checks can't be relied upon
# this cache would only become invalid when the current working directory changes, which only happens in tests and not during normal execution
if not hasattr(exists_case_insensitive, 'all_article_paths_lowercased'):
article_set = set(normalised(article_path.lower()) for article_path in itertools.chain(list_all_dirs(), list_all_files(["."])))
article_set = set(normalised(article_path.lower()) for article_path in itertools.chain(list_all_dirs(["."]), list_all_files(["."])))
setattr(exists_case_insensitive, 'all_article_paths_lowercased', article_set)
all_article_paths_lowercased = getattr(exists_case_insensitive, 'all_article_paths_lowercased')

Expand Down

0 comments on commit 53a3793

Please sign in to comment.