Skip to content

Commit

Permalink
Add test for error case publishing markdown-with-index
Browse files Browse the repository at this point in the history
  • Loading branch information
robtaylor committed Oct 3, 2024
1 parent 804a208 commit 9a000f5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doorstop/cli/tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,13 +815,19 @@ def test_publish_tree_no_path(self):
self.assertRaises(SystemExit, main, ["publish", "all"])

def test_publish_tree_markdown_with_index(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"]))

def test_publish_tree_markdown_with_index_no_tree(self):
"""Verify 'doorstop publish' can create Markdown output for a tree,
with an index."""
path = os.path.join(self.temp, "all")
self.assertIs(None, main(["publish", "all", path, "--markdown", "--index"]))
self.assertTrue(os.path.isdir(path))
self.assertFalse(os.path.isfile(os.path.join(path, "index.html")))

self.assertFalse(os.path.isfile(os.path.j


class TestPublishCommand(TempTestCase):
Expand Down

0 comments on commit 9a000f5

Please sign in to comment.