@@ -796,6 +796,23 @@ def test_publish_document_html_file(self):
796
796
filePath = os .path .join (self .temp , "documents" , "req.html" )
797
797
self .assertTrue (os .path .isfile (filePath ))
798
798
799
+ def test_publish_document_md_file_no_toc (self ):
800
+ """Verify 'doorstop publish --no-toc' creates an MarkDownfile with no TOC."""
801
+ path = os .path .join (self .temp , "req.md" )
802
+ self .assertIs (None , main (["publish" , "--no-toc" , "req" , path ]))
803
+ self .assertTrue (os .path .isfile (path ))
804
+ text = common .read_text (path )
805
+ self .assertNotIn ("Table of Contents" , text )
806
+
807
+ def test_publish_document_html_file_no_toc (self ):
808
+ """Verify 'doorstop publish --no-toc' creates an HTML file with no TOC."""
809
+ path = os .path .join (self .temp , "req.html" )
810
+ self .assertIs (None , main (["publish" , "--no-toc" , "req" , path ]))
811
+ filePath = os .path .join (self .temp , "documents" , "req.html" )
812
+ self .assertTrue (os .path .isfile (filePath ))
813
+ text = common .read_text (filePath )
814
+ self .assertNotIn ("Table of Contents" , text )
815
+
799
816
def test_publish_tree_html (self ):
800
817
"""Verify 'doorstop publish' can create an HTML directory."""
801
818
path = os .path .join (self .temp , "all" )
@@ -842,6 +859,13 @@ def test_publish_markdown_tree_no_path(self):
842
859
],
843
860
)
844
861
862
+ def test_publish_tree_html_no_toc (self ):
863
+ """Verify 'doorstop publish --no-toc' returns a html document with no toc."""
864
+ path = os .path .join (self .temp , "all" )
865
+ self .assertIs (None , main (["publish" , "--no-toc" , "all" , path ]))
866
+ self .assertTrue (os .path .isdir (path ))
867
+ self .assertTrue (os .path .isfile (os .path .join (path , "index.html" )))
868
+
845
869
846
870
class TestPublishCommand (TempTestCase ):
847
871
"""Tests 'doorstop publish' options toc and template"""
0 commit comments