Beispiel #1
0
 def test_rest_to_html_pypi_strict_clean_failure(self):
     # Certain versions of readme_renderer could return `None`
     # from the clean() helper.  New versions don't (or at least
     # do in different circumstances), so we have to mock out
     # the helper to keep this test.
     viewer = RestViewer('.')
     viewer.pypi_strict = True
     html = viewer.rest_to_html(b'''
         [http://localhost:3000](http://localhost:3000)
     ''')
     self.assertIn('<title>ValueError</title>', html)
     self.assertIn('Output cleaning failed', html)
Beispiel #2
0
 def test_rest_to_html_report_level(self):
     viewer = RestViewer('.')
     viewer.report_level = 1
     html = viewer.rest_to_html(b'.. _unused:\n\nEtc.')
     self.assertIn('System Message: INFO/1', html)
Beispiel #3
0
 def test_rest_to_html_halt_level(self):
     viewer = RestViewer('.')
     viewer.halt_level = 2
     html = viewer.rest_to_html(b'`Hello')
     self.assertIn('<title>SystemMessage</title>', html)
Beispiel #4
0
 def test_serve(self):
     viewer = RestViewer('.')
     viewer.server = Mock()
     viewer.serve()
     self.assertEqual(viewer.server.serve_forever.call_count, 1)
Beispiel #5
0
 def test_serve(self):
     viewer = RestViewer('.')
     viewer.server = Mock()
     viewer.serve()
     viewer.server.serve_forever.assert_called_once()
Beispiel #6
0
 def setup_method(self, method):
     self.viewer = RestViewer('.')
     self.viewer.css_path = self.viewer.css_url = None
     self.viewer.strict = True