Skip to content

Commit 09ed64d

Browse files
committed
Test against untracked page
1 parent ff1843b commit 09ed64d

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

tests/test_build.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,28 @@ def test_bad_config(self):
351351
self.assertEqual(cli_result.exit_code, 2)
352352
self.assertIsNotNone(cli_result.exception)
353353

354+
def test_not_in_git_log(self):
355+
# add a new page without tracking it
356+
md_str = """# This page is dynamically created for test purposes\n\nHi!\n
357+
"""
358+
temp_page = Path("tests/fixtures/docs/temp_page_not_in_git_log.md")
359+
if temp_page.exists():
360+
temp_page.unlink()
361+
temp_page.write_text(md_str)
362+
363+
with tempfile.TemporaryDirectory() as tmpdirname:
364+
cli_result = self.build_docs_setup(
365+
testproject_path="docs",
366+
mkdocs_yml_filepath=Path("tests/fixtures/mkdocs_disabled.yml"),
367+
output_path=tmpdirname,
368+
)
369+
if cli_result.exception is not None:
370+
e = cli_result.exception
371+
logger.debug(format_exception(type(e), e, e.__traceback__))
372+
373+
self.assertEqual(cli_result.exit_code, 0)
374+
self.assertIsNone(cli_result.exception)
375+
354376

355377
# ##############################################################################
356378
# ##### Stand alone program ########

0 commit comments

Comments
 (0)