[Zope-Checkins] CVS: Zope/lib/python/Products/PythonScripts/tests - testPythonScript.py:1.7 framework.py:NONE

Tres Seaver tseaver@zope.com
Wed, 17 Oct 2001 16:01:04 -0400


Update of /cvs-repository/Zope/lib/python/Products/PythonScripts/tests
In directory cvs.zope.org:/tmp/cvs-serv30119/lib/python/Products/PythonScripts/tests

Modified Files:
	testPythonScript.py 
Removed Files:
	framework.py 
Log Message:


  o Land unit test cleanup from branch.

  o Known breakage as of 2001/10/17:

    - TAL test suite is very broken (TAL is currently suppressed in
      lib/python/.testinfo).

    - AccessControl tests don't run if run first;  lib/python/.testinfo
      pushes them to the end of the queue, at which point they *do* run.
      Global side effects suck!

    - lib/python/BTrees/testBTreesUnicode.py:  weird flakiness around
      comparison of ASCII and Unicode strings;  breaks in different
      ways under Python 2.1 and 2.2.

    - lib/python/Products/PageTemplates/tests:  three tests break due
      to security asserctions.


=== Zope/lib/python/Products/PythonScripts/tests/testPythonScript.py 1.6 => 1.7 ===
 # 
 ##############################################################################
-import os, sys
-execfile(os.path.join(sys.path[0], 'framework.py'))
+import os, sys, unittest
 
 import ZODB
 from Products.PythonScripts.PythonScript import PythonScript
@@ -91,10 +90,21 @@
 
 newSecurityManager(None, None)
 
+if __name__=='__main__':
+    sys.path.append(os.path.join(os.pardir, os.pardir, os.pardir))
+    here = os.curdir
+else:
+    from Products.PythonScripts import tests
+    from App.Common import package_home
+    here = package_home(tests.__dict__)
+
 # Test Classes
 
 def readf(name):
-    return open('tscripts/%s%s' % (name, '.ps'), 'r').read()
+    return open( os.path.join( here
+                             , 'tscripts'
+                             , '%s.ps' % name
+                             ), 'r').read()
 
 class TestPythonScriptNoAq(unittest.TestCase):
     def _newPS(self, txt, bind=None):
@@ -208,5 +218,14 @@
         true = self._newPS(readf('boolean_map'))()
         assert true
 
-framework()
+def test_suite():
+    suite = unittest.TestSuite()
+    suite.addTest( unittest.makeSuite( TestPythonScriptNoAq ) )
+    return suite
+
+def main():
+    unittest.TextTestRunner().run(test_suite())
+
+if __name__ == '__main__':
+    main()
 

=== Removed File Zope/lib/python/Products/PythonScripts/tests/framework.py ===