[Checkins] SVN: grok/trunk/src/grok/admin/ Make the grok admin UI tests also work on Windows.

Martijn Faassen faassen at infrae.com
Tue Aug 21 18:09:26 EDT 2007


Log message for revision 79105:
  Make the grok admin UI tests also work on Windows.
  

Changed:
  U   grok/trunk/src/grok/admin/docgrok.txt
  U   grok/trunk/src/grok/admin/objectinfo.txt
  U   grok/trunk/src/grok/admin/tests/test_grokadmin.py

-=-
Modified: grok/trunk/src/grok/admin/docgrok.txt
===================================================================
--- grok/trunk/src/grok/admin/docgrok.txt	2007-08-21 22:06:47 UTC (rev 79104)
+++ grok/trunk/src/grok/admin/docgrok.txt	2007-08-21 22:09:25 UTC (rev 79105)
@@ -201,7 +201,7 @@
 class. But, where can we find the definition of it in file system? Ask
 the doc:
 
-    >>> doctor.getFilePath()
+    >>> pnorm(doctor.getFilePath())
     '.../grok/__init__.py'
 
 This is not exactly, what we wanted to know, is it? We got the package
@@ -214,7 +214,7 @@
 To check it, let's see, what happens, if we give the real dotted path:
 
     >>> doctor = DocGrokGrokView('grok.components.View')
-    >>> doctor.getFilePath()
+    >>> pnorm(doctor.getFilePath())
     '.../grok/components.py'
 
 Ah, right. This is, what we wanted. Now we can use some of the derived

Modified: grok/trunk/src/grok/admin/objectinfo.txt
===================================================================
--- grok/trunk/src/grok/admin/objectinfo.txt	2007-08-21 22:06:47 UTC (rev 79104)
+++ grok/trunk/src/grok/admin/objectinfo.txt	2007-08-21 22:09:25 UTC (rev 79105)
@@ -141,7 +141,7 @@
 
   >>> filename = ObjectInfo(grok.admin.objectinfo.ObjectInfo).getfile()
   >>> filename = filename[-1] == 'c' and filename or filename + 'c'
-  >>> filename
+  >>> pnorm(filename)
   '.../grok/admin/objectinfo.pyc'
 
 
@@ -154,7 +154,7 @@
   >>> info.getsourcefile() is None
   True
 
-  >>> ObjectInfo(grok.admin.objectinfo.ObjectInfo).getsourcefile()
+  >>> pnorm(ObjectInfo(grok.admin.objectinfo.ObjectInfo).getsourcefile())
   '.../grok/admin/objectinfo.py'
 
   >>> info.getsourcelines() is None

Modified: grok/trunk/src/grok/admin/tests/test_grokadmin.py
===================================================================
--- grok/trunk/src/grok/admin/tests/test_grokadmin.py	2007-08-21 22:06:47 UTC (rev 79104)
+++ grok/trunk/src/grok/admin/tests/test_grokadmin.py	2007-08-21 22:09:25 UTC (rev 79105)
@@ -13,6 +13,7 @@
 ##############################################################################
 """Setup for tests."""
 
+import os
 import unittest
 from pkg_resources import resource_listdir
 from zope.testing import doctest, cleanup
@@ -47,13 +48,22 @@
         suite.addTest(test)
     return suite
 
+def pnorm(path):
+    """Normalization of paths to use forward slashes. This is needed
+    to make sure the tests work on windows.
+    """
+    return path.replace(os.sep, '/')
+
 def test_suite():
     suite = unittest.TestSuite()
+    globs = {'pnorm': pnorm}
+
     for name in []:
         suite.addTest(suiteFromPackage(name))
     for name in ['docgrok.txt','objectinfo.txt', 'utilities.py']:
         suite.addTest(doctest.DocFileSuite(name,
                                            package='grok.admin',
+                                           globs=globs,
                                            setUp=setUpZope,
                                            tearDown=cleanUpZope,
                                            optionflags=doctest.ELLIPSIS+



More information about the Checkins mailing list