[Checkins] SVN: Products.PythonScripts/trunk/ LP #1047318 - adjust tests
Hano Schlichting
cvs-admin at zope.org
Sun Sep 9 10:38:23 UTC 2012
Log message for revision 127780:
LP #1047318 - adjust tests
Changed:
U Products.PythonScripts/trunk/CHANGES.txt
U Products.PythonScripts/trunk/setup.py
U Products.PythonScripts/trunk/src/Products/PythonScripts/tests/testPythonScript.py
-=-
Modified: Products.PythonScripts/trunk/CHANGES.txt
===================================================================
--- Products.PythonScripts/trunk/CHANGES.txt 2012-09-09 10:32:43 UTC (rev 127779)
+++ Products.PythonScripts/trunk/CHANGES.txt 2012-09-09 10:38:19 UTC (rev 127780)
@@ -1,9 +1,10 @@
Changelog
=========
-2.13.1 (unreleased)
+2.13.1 (2012-09-09)
-------------------
+- LP #1047318: Adjust tests.
2.13.0 (2010-07-10)
-------------------
Modified: Products.PythonScripts/trunk/setup.py
===================================================================
--- Products.PythonScripts/trunk/setup.py 2012-09-09 10:32:43 UTC (rev 127779)
+++ Products.PythonScripts/trunk/setup.py 2012-09-09 10:38:19 UTC (rev 127780)
@@ -15,7 +15,7 @@
from setuptools import setup, find_packages
setup(name='Products.PythonScripts',
- version = '2.13.1dev',
+ version = '2.13.1',
url='http://pypi.python.org/pypi/Products.PythonScripts',
license='ZPL 2.1',
description="Provides support for restricted execution of Python "
Modified: Products.PythonScripts/trunk/src/Products/PythonScripts/tests/testPythonScript.py
===================================================================
--- Products.PythonScripts/trunk/src/Products/PythonScripts/tests/testPythonScript.py 2012-09-09 10:32:43 UTC (rev 127779)
+++ Products.PythonScripts/trunk/src/Products/PythonScripts/tests/testPythonScript.py 2012-09-09 10:38:19 UTC (rev 127780)
@@ -64,10 +64,23 @@
class PythonScriptTestBase(unittest.TestCase):
def setUp(self):
+ from AccessControl import ModuleSecurityInfo as MSI
+ from AccessControl.SecurityInfo import _moduleSecurity
+ from AccessControl.SecurityInfo import _appliedModuleSecurity
+ self._ms_before = _moduleSecurity.copy()
+ self._ams_before = _appliedModuleSecurity.copy()
+ MSI('string').declarePublic('split')
+ MSI('sets').declarePublic('Set')
newSecurityManager(None, None)
def tearDown(self):
+ from AccessControl.SecurityInfo import _moduleSecurity
+ from AccessControl.SecurityInfo import _appliedModuleSecurity
noSecurityManager()
+ _moduleSecurity.clear()
+ _moduleSecurity.update(self._ms_before)
+ _appliedModuleSecurity.clear()
+ _appliedModuleSecurity.update(self._ams_before)
def _newPS(self, txt, bind=None):
ps = VerifiedPythonScript('ps')
@@ -128,9 +141,6 @@
res = self._newPS('return 1 * 5 + 4 / 2 - 6')()
self.assertEqual(res, 1)
- def testCollector2295(self):
- res = self._newPS('if False:\n pass\n#hi')
-
def testReduce(self):
res = self._newPS('return reduce(lambda x, y: x + y, [1,3,5,7])')()
self.assertEqual(res, 16)
More information about the checkins
mailing list