[Zope-Checkins]
CVS: Releases/Zope/lib/python/Products/PythonScripts/tests
- testPythonScript.py:1.12.68.4
Evan Simpson
evan at 4-am.com
Fri Feb 13 11:59:38 EST 2004
Update of /cvs-repository/Releases/Zope/lib/python/Products/PythonScripts/tests
In directory cvs.zope.org:/tmp/cvs-serv20148/lib/python/Products/PythonScripts/tests
Modified Files:
Tag: Zope-2_7-branch
testPythonScript.py
Log Message:
DeprecationWarnings in Scripts were converted into mysterious exceptions. Scripts now gain a '_filepath' attribute, used at runtime as the '__file__' global value.
=== Releases/Zope/lib/python/Products/PythonScripts/tests/testPythonScript.py 1.12.68.3 => 1.12.68.4 ===
--- Releases/Zope/lib/python/Products/PythonScripts/tests/testPythonScript.py:1.12.68.3 Thu Jan 15 14:43:29 2004
+++ Releases/Zope/lib/python/Products/PythonScripts/tests/testPythonScript.py Fri Feb 13 11:59:06 2004
@@ -10,7 +10,7 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
-import os, unittest
+import os, unittest, warnings
from Products.PythonScripts.PythonScript import PythonScript
from AccessControl.SecurityManagement import newSecurityManager
@@ -40,6 +40,7 @@
class PythonScriptTestBase(unittest.TestCase):
def setUp(self):
+ # Turn deprecation warnings into exceptions
newSecurityManager(None, None)
def tearDown(self):
@@ -235,10 +236,12 @@
self.assertEqual(results, 8)
def test__name__(self):
- fname = 'class.__name__'
- f = self._filePS(fname)
+ f = self._filePS('class.__name__')
self.assertEqual(f(), ('?.foo', "'string'"))
+ def test_filepath(self):
+ f = self._filePS('filepath')
+ self.assertEqual(f(), [0])
def test_suite():
suite = unittest.TestSuite()
More information about the Zope-Checkins
mailing list