[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/publisher/xmlrpc/ Use zope.testing.renormalizing for the doctest (is it better?).

Florent Xicluna laxyf at yahoo.fr
Wed Sep 20 18:10:04 EDT 2006


Log message for revision 70273:
  Use zope.testing.renormalizing for the doctest (is it better?).
  Rewrite tearDown function to get rid of ztapi.
  

Changed:
  U   Zope3/trunk/src/zope/app/publisher/xmlrpc/README.txt
  U   Zope3/trunk/src/zope/app/publisher/xmlrpc/ftests.py

-=-
Modified: Zope3/trunk/src/zope/app/publisher/xmlrpc/README.txt
===================================================================
--- Zope3/trunk/src/zope/app/publisher/xmlrpc/README.txt	2006-09-20 21:31:03 UTC (rev 70272)
+++ Zope3/trunk/src/zope/app/publisher/xmlrpc/README.txt	2006-09-20 22:10:04 UTC (rev 70273)
@@ -277,7 +277,7 @@
 
   >>> proxy = ServerProxy("http://mgr:mgrpw@localhost/")
   >>> proxy.epoch()
-  <DateTime ...'19700101T01:00:01' at ...>
+  <DateTime u'19700101T01:00:01' at <SOME ADDRESS>>
 
 Handling errors with the ServerProxy
 ------------------------------------

Modified: Zope3/trunk/src/zope/app/publisher/xmlrpc/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/xmlrpc/ftests.py	2006-09-20 21:31:03 UTC (rev 70272)
+++ Zope3/trunk/src/zope/app/publisher/xmlrpc/ftests.py	2006-09-20 22:10:04 UTC (rev 70273)
@@ -15,11 +15,16 @@
 
 $Id$
 """
+import re
+
+import zope.component
 import zope.interface
-import zope.app.folder.folder
 import zope.publisher.interfaces.xmlrpc
-from zope.app.testing import ztapi, functional, setup
+from zope.testing import renormalizing
 
+import zope.app.folder.folder
+from zope.app.testing import functional, setup
+
 def setUp(test):
     setup.setUpTestAsModule(test, 'zope.app.publisher.xmlrpc.README')
 
@@ -31,24 +36,22 @@
     # requires the object that was registered and we don't have that handy.
     # (OK, we could get it if we want. Maybe later.)
 
-    ztapi.provideView(zope.app.folder.folder.IFolder,
-                        zope.publisher.interfaces.xmlrpc.IXMLRPCRequest,
-                        zope.interface,
-                        'contents',
-                        None,
-                        )
-    ztapi.provideView(zope.app.folder.folder.IFolder,
-                        zope.publisher.interfaces.xmlrpc.IXMLRPCRequest,
-                        zope.interface,
-                        'contents',
-                        None,
-                        )
-    
+    zope.component.provideAdapter(None, (
+        zope.app.folder.folder.IFolder,
+        zope.publisher.interfaces.xmlrpc.IXMLRPCRequest
+        ), zope.interface, 'contents')
+
     setup.tearDownTestAsModule(test)
 
 def test_suite():
+    checker = renormalizing.RENormalizing((
+        (re.compile('<DateTime \''), '<DateTime u\''),
+        (re.compile('at [-0-9a-fA-F]+'), 'at <SOME ADDRESS>'),
+        ))
     return functional.FunctionalDocFileSuite(
-        'README.txt', setUp=setUp, tearDown=tearDown)
+        'README.txt', setUp=setUp, tearDown=tearDown,
+        checker=checker
+        )
 
 if __name__ == '__main__':
     import unittest



More information about the Zope3-Checkins mailing list