[Checkins] SVN: z3c.versionedresource/trunk/ * Fixed most of the tests to run with ZTK 1.0 and on Mac OS X, too.

Michael Howitz mh at gocept.com
Tue Nov 2 03:47:54 EDT 2010


Log message for revision 118123:
  * Fixed most of the tests to run with ZTK 1.0 and on Mac OS X, too.
  
  * Using Python's ``doctest`` module instead of depreacted
    ``zope.testing.doctest``.
  
  

Changed:
  U   z3c.versionedresource/trunk/CHANGES.txt
  U   z3c.versionedresource/trunk/src/z3c/versionedresource/README.txt
  U   z3c.versionedresource/trunk/src/z3c/versionedresource/tests/test_doc.py

-=-
Modified: z3c.versionedresource/trunk/CHANGES.txt
===================================================================
--- z3c.versionedresource/trunk/CHANGES.txt	2010-11-02 07:47:20 UTC (rev 118122)
+++ z3c.versionedresource/trunk/CHANGES.txt	2010-11-02 07:47:54 UTC (rev 118123)
@@ -1,3 +1,10 @@
+========
+ Issues
+========
+
+* Some tests break strangely. (Even depending on parameters of `bin/test`
+  call (`-v` vs. no parameters)!) Should be fixed before next release.
+
 =======
 CHANGES
 =======
@@ -5,8 +12,11 @@
 Version 0.6.0 (unreleased)
 --------------------------
 
-- ...
+* Fixed most of the tests to run with ZTK 1.0 and on Mac OS X, too.
 
+* Using Python's ``doctest`` module instead of depreacted
+  ``zope.testing.doctest``.
+
 Version 0.5.0 (2009-07-30)
 --------------------------
 

Modified: z3c.versionedresource/trunk/src/z3c/versionedresource/README.txt
===================================================================
--- z3c.versionedresource/trunk/src/z3c/versionedresource/README.txt	2010-11-02 07:47:20 UTC (rev 118122)
+++ z3c.versionedresource/trunk/src/z3c/versionedresource/README.txt	2010-11-02 07:47:54 UTC (rev 118123)
@@ -94,7 +94,7 @@
 When traversing to a sub-item, the version can be specified:
 
   >>> resources.publishTraverse(request, '1.0.0')
-  <zope.app.publisher.browser.resources.Resources ...>
+  <zope.browserresource.resources.Resources ...>
 
 The result of the traversal is the original resources object. When asking for
 an unknown resource or version, a ``NotFound`` is raised:
@@ -116,7 +116,7 @@
 
   >>> css = resources.publishTraverse(request, 'resource.css')
   >>> css
-  <zope.app.publisher.browser.resource.Resource object at ...>
+  <zope.browserresource.resource.Resource object at ...>
 
 Calling it will return the URL:
 
@@ -262,7 +262,7 @@
 
   >>> resources.publishTraverse(request, '1.0.0')\
   ...          .publishTraverse(request, 'zcml-test.txt').context
-  <zope.app.publisher.fileresource.File object at ...>
+  <zope.browserresource.file.File object at ...>
 
   >>> unregister('zcml-test.txt')
 
@@ -280,7 +280,7 @@
 
   >>> resources.publishTraverse(request, '1.0.0')\
   ...          .publishTraverse(request, 'zcml-test.html').context
-  <zope.app.publisher.pagetemplateresource.PageTemplate object at ...>
+  <zope.ptresource.ptresource.PageTemplate object at ...>
 
 Note that the page template resource cannot be a versioned resource, since it
 has dynamic components:
@@ -400,15 +400,15 @@
   /.../1.0.0
 
   >>> ls(outdir)
-  d 1.0.0             4096
+  d 1.0.0
   >>> ls(os.path.join(outdir, '1.0.0'))
-  d zcml-subdir       4096
-  f zcml-test.gif     909
+  d zcml-subdir
+  f zcml-test.gif
   >>> ls(os.path.join(outdir, '1.0.0', 'zcml-subdir'))
-  d subsubdir         4096
-  f test.gif          909
+  d subsubdir
+  f test.gif
   >>> ls(os.path.join(outdir, '1.0.0', 'zcml-subdir', 'subsubdir'))
-  f subtest.gif       909
+  f subtest.gif
 
 The module consists of several small helper functions, so let's look at them
 to verify their correct behavior.
@@ -456,27 +456,27 @@
 
   >>> list.storeResource(outdir, resources[1][0], resources[1][1])
   >>> ls(outdir)
-  f zcml-test.gif     909
+  f zcml-test.gif
 
 Let's now zip it:
 
   >>> list.storeResource(outdir, resources[1][0], resources[1][1], True)
   >>> ls(outdir)
-  f zcml-test.gif     252
+  f zcml-test.gif
 
 When storing a directory resource, all sub-items are stored as well:
 
   >>> list.storeResource(outdir, resources[0][0], resources[0][1], True)
   >>> ls(outdir)
-  d zcml-subdir       4096
-  f zcml-test.gif     252
+  d zcml-subdir
+  f zcml-test.gif
 
   >>> ls(os.path.join(outdir, 'zcml-subdir'))
-  d subsubdir 4096
-  f test.gif  259
+  d subsubdir
+  f test.gif
 
   >>> ls(os.path.join(outdir, 'zcml-subdir', 'subsubdir'))
-  f subtest.gif       272
+  f subtest.gif
 
 
 Some odds and ends

Modified: z3c.versionedresource/trunk/src/z3c/versionedresource/tests/test_doc.py
===================================================================
--- z3c.versionedresource/trunk/src/z3c/versionedresource/tests/test_doc.py	2010-11-02 07:47:20 UTC (rev 118122)
+++ z3c.versionedresource/trunk/src/z3c/versionedresource/tests/test_doc.py	2010-11-02 07:47:54 UTC (rev 118123)
@@ -20,7 +20,7 @@
 import unittest
 import zope.interface
 from zope.component import globalregistry
-from zope.testing import doctest
+import doctest
 from zope.app.testing import placelesssetup
 from zope.publisher.interfaces.browser import IDefaultBrowserLayer
 from zope.app.publisher.browser.resource import AbsoluteURL
@@ -47,10 +47,7 @@
 def ls(dir):
     for name in sorted(os.listdir(dir)):
         path = os.path.join(dir, name)
-        print '%s %s\t%i' %(
-            'd' if os.path.isdir(path) else 'f',
-            name,
-            os.stat(path).st_size)
+        print '%s %s' %('d' if os.path.isdir(path) else 'f', name)
 
 def setUp(test):
     placelesssetup.setUp(test)



More information about the checkins mailing list