[Zope-Checkins] CVS: Zope2 - restricted_module.py:1.4 testRestrictions.py:1.4
evan@serenade.digicool.com
evan@serenade.digicool.com
Thu, 17 May 2001 17:42:00 -0400
Update of /cvs-repository/Zope2/lib/python/RestrictedPython/tests
In directory serenade:/home/evan/Zope/trunk/lib/python/RestrictedPython/tests
Modified Files:
restricted_module.py testRestrictions.py
Log Message:
Fix "print >>None" and test it.
--- Updated File restricted_module.py in package Zope2 --
--- restricted_module.py 2001/05/14 16:41:38 1.3
+++ restricted_module.py 2001/05/17 21:42:00 1.4
@@ -1,6 +1,16 @@
-def print1():
+def print0():
print 'Hello, world!',
+ return printed
+
+def print1():
+ print 'Hello,',
+ print 'world!',
+ return printed
+
+def print2():
+ x = None
+ print >>x, 'Hello, world!',
return printed
def primes():
--- Updated File testRestrictions.py in package Zope2 --
--- testRestrictions.py 2001/05/14 16:41:38 1.3
+++ testRestrictions.py 2001/05/17 21:42:00 1.4
@@ -170,8 +170,9 @@
return func(*args, **kw)
def checkPrint(self):
- res = self.execFunc('print1')
- assert res == 'Hello, world!', res
+ for i in range(3):
+ res = self.execFunc('print%s' % i)
+ assert res == 'Hello, world!', res
def checkPrimes(self):
res = self.execFunc('primes')