Skip to content

Commit 137c5e7

Browse files
ldeluigitimvink
authored andcommitted
Add fallback options tests
1 parent 272dc8f commit 137c5e7

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/test_basic.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,34 @@ def test_building_empty_site(tmp_path):
111111
)
112112

113113
os.chdir(cwd)
114+
115+
116+
def test_fallback(tmp_path):
117+
"""
118+
Structure:
119+
120+
tmp_path/testproject
121+
website/
122+
├── docs/
123+
└── mkdocs.yml"""
124+
testproject_path = tmp_path / "testproject"
125+
126+
shutil.copytree(
127+
"tests/basic_setup/empty_site", str(testproject_path / "website" / "docs")
128+
)
129+
shutil.copyfile(
130+
"tests/basic_setup/mkdocs_w_contribution.yml",
131+
str(testproject_path / "website" / "mkdocs.yml"),
132+
)
133+
134+
cwd = os.getcwd()
135+
os.chdir(str(testproject_path))
136+
137+
result = build_docs_setup(
138+
str(testproject_path / "website/mkdocs.yml"), str(testproject_path / "site")
139+
)
140+
assert result.exit_code == 0, (
141+
"'mkdocs build' command failed. Error: %s" % result.stdout
142+
)
143+
144+
os.chdir(cwd)

0 commit comments

Comments
 (0)