From 16f0cb2c20342f5ca133700411d191e078af25b9 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doorstop/cli/tests/test_all.py b/doorstop/cli/tests/test_all.py index 7d755d9c..290609f3 100644 --- a/doorstop/cli/tests/test_all.py +++ b/doorstop/cli/tests/test_all.py @@ -822,6 +822,14 @@ def test_publish_tree_markdown_with_index(self): self.assertTrue(os.path.isdir(path)) self.assertTrue(os.path.isfile(os.path.join(path, "index.html"))) + 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.remove(path) + self.assertRaises( + SystemExit, main(["publish", "all", path, "--markdown", "--index"]) + ) class TestPublishCommand(TempTestCase):