Skip to content

Commit d1f892a

Browse files
committed
Add test for mkdocs-macros-plugin compatiblity, see #60
1 parent b624fc1 commit d1f892a

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
site_name: test gitauthors_plugin
2+
use_directory_urls: true
3+
4+
plugins:
5+
- search
6+
- macros
7+
- git-authors

tests/test_basic.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,26 @@ def test_basic_working(tmp_path):
6767

6868
contents = index_file.read_text()
6969
assert re.search("<span class='git-page-authors", contents)
70+
assert re.search("<li><a href='mailto:[email protected]'>Tim Vink</a></li>", contents)
71+
72+
73+
def test_basic_working_macros(tmp_path):
74+
"""
75+
combination with mkdocs-macros-plugin lead to error.
76+
77+
See https://github.com/timvink/mkdocs-git-authors-plugin/issues/60
78+
"""
79+
result = build_docs_setup("tests/basic_setup/mkdocs_w_macros.yml", tmp_path)
80+
assert result.exit_code == 0, (
81+
"'mkdocs build' command failed. Error: %s" % result.stdout
82+
)
83+
84+
index_file = tmp_path / "index.html"
85+
assert index_file.exists(), "%s does not exist" % index_file
86+
87+
contents = index_file.read_text()
88+
assert re.search("<span class='git-page-authors", contents)
89+
assert re.search("<li><a href='mailto:[email protected]'>Tim Vink</a></li>", contents)
7090

7191

7292
def test_exclude_working(tmp_path):

tests/test_requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ codecov
77
click
88
GitPython
99

10+
# other plugins
11+
mkdocs-macros-plugin
12+
1013
# mkdocs
1114
mkdocs
1215
mkdocs-git-revision-date-localized-plugin

0 commit comments

Comments
 (0)