def test_hidden_toctree_non_html(self): style = ReSTStyle(ReSTDocument()) style.doc.target = 'man' style.hidden_toctree() style.hidden_tocitem('foo') style.hidden_tocitem('bar') self.assertEqual(style.doc.getvalue(), b'')
def test_hidden_toctree_html(self): style = ReSTStyle(ReSTDocument()) style.doc.target = 'html' style.hidden_toctree() style.hidden_tocitem('foo') style.hidden_tocitem('bar') self.assertEqual( style.doc.getvalue(), b'\n.. toctree::\n :maxdepth: 1\n :hidden:\n\n foo\n bar\n')