[Zope3-checkins] CVS: zopeproducts/zwiki/renderer/tests - test_rest.py:1.3

Fred L. Drake, Jr. fred@zope.com
Mon, 14 Apr 2003 12:47:28 -0400


Update of /cvs-repository/zopeproducts/zwiki/renderer/tests
In directory cvs.zope.org:/tmp/cvs-serv16104

Modified Files:
	test_rest.py 
Log Message:
- skip these tests when docutils isn't installed
- wrap a long line
- normalize whitespace


=== zopeproducts/zwiki/renderer/tests/test_rest.py 1.2 => 1.3 ===
--- zopeproducts/zwiki/renderer/tests/test_rest.py:1.2	Sat Apr 12 19:45:31 2003
+++ zopeproducts/zwiki/renderer/tests/test_rest.py	Mon Apr 14 12:47:28 2003
@@ -19,7 +19,8 @@
 
 from zope.publisher.browser import TestRequest
 
-from zopeproducts.zwiki.interfaces import IReStructuredTextSource, IHTMLRenderer
+from zopeproducts.zwiki.interfaces import \
+     IReStructuredTextSource, IHTMLRenderer
 from zopeproducts.zwiki.renderer.rest import \
      ReStructuredTextSource, ReStructuredTextToHTMLRenderer
 
@@ -62,7 +63,7 @@
         self._renderer.context = ReStructuredTextSource(self._source+comment)
 
         self.assertEqual(rendered_source_comment, self._renderer.render(None))
-        
+
 
 comment = '''
 
@@ -84,12 +85,17 @@
 </div>
 '''
 
-    
+
 def test_suite():
-    return unittest.TestSuite((
-        unittest.makeSuite(ReStructuredTextTest),
-        unittest.makeSuite(HTMLRendererTest),
-        ))
+    suite = unittest.TestSuite()
+    try:
+        import docutils
+    except ImportError:
+        pass
+    else:
+        suite.addTest(unittest.makeSuite(ReStructuredTextTest))
+        suite.addTest(unittest.makeSuite(HTMLRendererTest))
+    return suite
 
 if __name__ == '__main__':
     unittest.main()