[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/ Tweak reST/STX dependent tests so that they pass on both the

Philipp von Weitershausen philikon at philikon.de
Mon Jul 25 20:23:08 EDT 2005


Log message for revision 37415:
  Tweak reST/STX dependent tests so that they pass on both the
  Zope 2.8 and the X3.0 release line. These are the tests that
  were previously disabled on the Zope-X3.0.0-2.8 branch
  (except for the access log test which seems to pass now.)
  

Changed:
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/browser.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/tests.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/browser.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/tests.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/renderer/rest.py

-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/browser.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/browser.py	2005-07-25 22:11:01 UTC (rev 37414)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/browser.py	2005-07-26 00:23:07 UTC (rev 37415)
@@ -574,8 +574,13 @@
           >>> from tests import getClassDetailsView
           >>> view = getClassDetailsView()
 
-          >>> print view.getDoc()[23:80]
-          <p>Represent the Documentation of any possible class.</p>
+          We need to be a little weird about this test here because
+          reST/STX behaviour changes from Zope X3.0 to Zope 2.8 (which
+          X3.0 is a part of):
+
+          >>> '<p>Represent the Documentation of any possible class.</p>' \\
+          ...     in view.getDoc()
+          True
         """
         return renderText(self.context.getDocString() or '',
                           zapi.getParent(self.context).getPath())
@@ -594,12 +599,15 @@
           >>> from tests import getModuleDetailsView
           >>> view = getModuleDetailsView()
 
-          >>> print view.getDoc().strip()
-          <div class="document">
-          <p>Class Documentation Module</p>
-          <p>This module is able to take a dotted name of any class and display
-          documentation for it.</p>
-          </div>
+          We need to be a little weird about this test here because
+          reST/STX behaviour changes from Zope X3.0 to Zope 2.8 (which
+          X3.0 is a part of):
+
+          >>> '''\\
+          ... <p>Class Documentation Module</p>
+          ... <p>This module is able to take a dotted name of any class and display
+          ... documentation for it.</p>''' in view.getDoc().strip()
+          True
         """
         text = self.context.getDocString()
         if text is None:

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/tests.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/tests.py	2005-07-25 22:11:01 UTC (rev 37414)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/tests.py	2005-07-26 00:23:07 UTC (rev 37415)
@@ -111,4 +111,4 @@
         ))
 
 if __name__ == '__main__':
-    unittest.main()
+    unittest.main(defaultTest='test_suite')

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/browser.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/browser.py	2005-07-25 22:11:01 UTC (rev 37414)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/browser.py	2005-07-26 00:23:07 UTC (rev 37415)
@@ -240,8 +240,13 @@
 
           >>> from tests import getInterfaceDetails
           >>> details = getInterfaceDetails()
-          >>> details.getDoc()[:55]
-          '<div class="document">\n<p>This is the Foo interface</p>'
+
+          We need to be a little weird about this test here because
+          reST/STX behaviour changes from Zope X3.0 to Zope 2.8 (which
+          X3.0 is a part of):
+
+          >>> '<p>This is the Foo interface</p>' in details.getDoc()
+          True
         """
         # We must remove all proxies here, so that we get the context's
         # __module__ attribute. If we only remove security proxies, the

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/tests.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/tests.py	2005-07-25 22:11:01 UTC (rev 37414)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/tests.py	2005-07-26 00:23:07 UTC (rev 37415)
@@ -80,7 +80,6 @@
 class Foo(object):
     implements(IFoo)
 
-
 def getInterfaceDetails():
     ifacemodule = InterfaceModule()
     ifacemodule.__parent__ = Root()
@@ -90,8 +89,8 @@
     view.context = iface
     view.request = TestRequest()
     return view
-    
 
+
 def setUp(test):
     placelesssetup.setUp()
     provideInterface(None, IDocumentationModule)
@@ -133,4 +132,4 @@
         ))
 
 if __name__ == '__main__':
-    unittest.main()
+    unittest.main(defaultTest='test_suite')

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/renderer/rest.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/renderer/rest.py	2005-07-25 22:11:01 UTC (rev 37414)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/renderer/rest.py	2005-07-26 00:23:07 UTC (rev 37415)
@@ -128,17 +128,19 @@
       ... This is more source.
       ... ''')
       >>> renderer = ReStructuredTextToHTMLRenderer(source, TestRequest())
-      >>> print renderer.render().strip()
-      <div class="document">
-      <p>This is source.</p>
-      <div class="section" id="header-3">
-      <h3><a name="header-3">Header 3</a></h3>
-      <p>This is more source.</p>
-      </div>
-      </div>
-    """ 
 
+    We need to be a little weird about this test here because reST/STX
+    behaviour changes from Zope X3.0 to Zope 2.8 (which X3.0 is a part
+    of):
 
+      >>> '''\
+      ... <p>This is source.</p>
+      ... <div class="section" id="header-3">
+      ... <h3><a name="header-3">Header 3</a></h3>
+      ... <p>This is more source.</p>
+      ... </div>''' in renderer.render().strip()
+      True
+    """
     implements(IHTMLRenderer)
     __used_for__ = IReStructuredTextSource
 



More information about the Zope3-Checkins mailing list