[Checkins] SVN: z3c.recipe.dev/branches/icemac-unix/src/z3c/recipe/dev/ tests now run on *nix platforms and with current packages

Michael Howitz mh at gocept.com
Thu Aug 12 02:16:16 EDT 2010


Log message for revision 115642:
  tests now run on *nix platforms and with current packages
  

Changed:
  U   z3c.recipe.dev/branches/icemac-unix/src/z3c/recipe/dev/README.txt
  U   z3c.recipe.dev/branches/icemac-unix/src/z3c/recipe/dev/tests.py

-=-
Modified: z3c.recipe.dev/branches/icemac-unix/src/z3c/recipe/dev/README.txt
===================================================================
--- z3c.recipe.dev/branches/icemac-unix/src/z3c/recipe/dev/README.txt	2010-08-12 06:15:23 UTC (rev 115641)
+++ z3c.recipe.dev/branches/icemac-unix/src/z3c/recipe/dev/README.txt	2010-08-12 06:16:16 UTC (rev 115642)
@@ -171,7 +171,7 @@
 
 The myapp-scrip.py contains the start code for our zope setup:
 
-  >>> cat('bin', 'myapp-script.py')
+  >>> cat('bin', 'myapp')
   #!"C:\Python24\python.exe"
   <BLANKLINE>
   import sys
@@ -182,10 +182,11 @@
     '/sample-buildout/eggs/zope.testing-3.7.1-py2.4.egg',
     '/sample-buildout/eggs/zc.recipe.egg-1.1.0-py2.4.egg',
     '/sample-buildout/eggs/zc.buildout-1.1.1-py2.4.egg',
-    '/site-packages',
+    '/sample-pyN.N.egg',
     '/sample-buildout/eggs/zconfig-2.6.1-py2.4.egg',
     '/sample-buildout/demo1',
     '/sample-buildout/eggs/zope.interface-3.5.0-py2.4-win32.egg',
+    '/sample-pyN.N.egg',
     ]
   <BLANKLINE>
   import os
@@ -249,7 +250,7 @@
   >>> write('hello', 'setup.py',
   ... '''
   ... from setuptools import setup
-  ... setup(name = 'hello')
+  ... setup(name='hello')
   ... ''')
 
 And let's define a python module which we use for our test:
@@ -277,7 +278,7 @@
   ... [helloworld]
   ... recipe = z3c.recipe.dev:script
   ... eggs = hello
-  ... module = hello.helloworld
+  ... module = helloworld
   ... method = helloWorld
   ...
   ... ''' % globals())
@@ -293,7 +294,7 @@
 
 And check the script again. Now we see the `helloWorld()` method is used:
 
-  >>> cat('bin', 'helloworld-script.py')
+  >>> cat('bin', 'helloworld')
   #!C:\Python24\python.exe
   <BLANKLINE>
   import sys
@@ -305,10 +306,10 @@
   sys.argv[0] = os.path.abspath(sys.argv[0])
   <BLANKLINE>
   <BLANKLINE>
-  import hello.helloworld
+  import helloworld
   <BLANKLINE>
   if __name__ == '__main__':
-      hello.helloworld.helloWorld()
+      helloworld.helloWorld()
 
 Now we can call the script:
 
@@ -336,7 +337,7 @@
   ... [helloworld]
   ... recipe = z3c.recipe.dev:script
   ... eggs = hello
-  ... module = hello.helloworld
+  ... module = helloworld
   ... method = helloWorld
   ... arguments = 'foo', 'bar'
   ...
@@ -352,7 +353,7 @@
 
 And check the script again. Now we see the `helloWorld()` method is used:
 
-  >>> cat('bin', 'helloworld-script.py')
+  >>> cat('bin', 'helloworld')
   #!C:\Python24\python.exe
   <BLANKLINE>
   import sys
@@ -364,10 +365,10 @@
   sys.argv[0] = os.path.abspath(sys.argv[0])
   <BLANKLINE>
   <BLANKLINE>
-  import hello.helloworld
+  import helloworld
   <BLANKLINE>
   if __name__ == '__main__':
-      hello.helloworld.helloWorld('foo', 'bar')
+      helloworld.helloWorld('foo', 'bar')
 
 Now we can call the script:
 

Modified: z3c.recipe.dev/branches/icemac-unix/src/z3c/recipe/dev/tests.py
===================================================================
--- z3c.recipe.dev/branches/icemac-unix/src/z3c/recipe/dev/tests.py	2010-08-12 06:15:23 UTC (rev 115641)
+++ z3c.recipe.dev/branches/icemac-unix/src/z3c/recipe/dev/tests.py	2010-08-12 06:16:16 UTC (rev 115642)
@@ -12,16 +12,13 @@
 #
 ##############################################################################
 
-import os, re, shutil, sys, tempfile
-import pkg_resources
-
+from zope.testing import renormalizing
+import doctest
+import re
+import unittest
 import zc.buildout.testing
 
-import unittest
-import zope.testing
-from zope.testing import doctest, renormalizing
 
-
 def test_start_error():
     """The start script will setup a egg based start hook for a Zope 3 setup.
     Let's create a buildout that installs it as an ordinary script:
@@ -44,6 +41,7 @@
     zc.buildout.testing.install_develop('z3c.recipe.dev', test)
     zc.buildout.testing.install('zope.testing', test)
     zc.buildout.testing.install('zope.interface', test)
+    zc.buildout.testing.install('zope.exceptions', test)
     zc.buildout.testing.install('zc.recipe.egg', test)
     zc.buildout.testing.install('ZConfig', test)
     zc.buildout.testing.install('zc.recipe.filestorage', test)
@@ -64,6 +62,7 @@
     (re.compile('-\S+-py\d[.]\d(-\S+)?.egg'),
      '-pyN.N.egg',
     ),
+    (re.compile('install_dir .*'), ''),
     zc.buildout.testing.normalize_path,
     zc.buildout.testing.normalize_script,
     zc.buildout.testing.normalize_egg_py,
@@ -72,11 +71,9 @@
 
 def test_suite():
     return unittest.TestSuite(
-        doctest.DocFileSuite('README.txt',
+        doctest.DocFileSuite(
+            'README.txt',
             setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown,
+            optionflags=doctest.NORMALIZE_WHITESPACE,
             checker=checker),
         )
-
-
-if __name__ == '__main__':
-    unittest.main(defaultTest='test_suite')



More information about the checkins mailing list