From 281b3fc93fc678c3e2022c0ed8e1f67c993a5667 Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Thu, 3 Oct 2024 00:00:25 -0400 Subject: [PATCH] Add test for error case publishing markdown-with-index --- doorstop/cli/tests/test_all.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doorstop/cli/tests/test_all.py b/doorstop/cli/tests/test_all.py index e2059da1..7c84efa4 100644 --- a/doorstop/cli/tests/test_all.py +++ b/doorstop/cli/tests/test_all.py @@ -822,6 +822,15 @@ def test_publish_tree_markdown_with_index(self): self.assertTrue(os.path.isdir(path)) self.assertTrue(os.path.isfile(os.path.join(path, "index.md"))) + def test_publish_tree_markdown_with_index_no_tree(self): + """Verify 'doorstop publish' can create Markdown output for a tree, + with an index.""" + path = tempfile.mkdtemp() + os.rmdir(path) + self.assertRaises( + SystemExit, main, ["publish", "all", path, "--markdown", "--index"] + ) + class TestPublishCommand(TempTestCase): """Tests 'doorstop publish' options toc and template"""