summaryrefslogtreecommitdiffstats
path: root/Lib/Bastion.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-08-20 20:21:52 (GMT)
committerGuido van Rossum <guido@python.org>1996-08-20 20:21:52 (GMT)
commit6ba66d01160ccb5a2dbf0d6a53cdf9fc35e48505 (patch)
treeafe6588bd9db7b9776a9b4292a35804615063fbb /Lib/Bastion.py
parent880d1eee958d1889c05f45ad91eb246831881170 (diff)
downloadcpython-6ba66d01160ccb5a2dbf0d6a53cdf9fc35e48505.zip
cpython-6ba66d01160ccb5a2dbf0d6a53cdf9fc35e48505.tar.gz
cpython-6ba66d01160ccb5a2dbf0d6a53cdf9fc35e48505.tar.bz2
Improved tests; run twice, onece in normal mode, once in restricted mode.
Diffstat (limited to 'Lib/Bastion.py')
-rw-r--r--Lib/Bastion.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/Bastion.py b/Lib/Bastion.py
index 7ddd93e..cb54be9 100644
--- a/Lib/Bastion.py
+++ b/Lib/Bastion.py
@@ -141,6 +141,7 @@ def _test():
return self.sum
o = Original()
b = Bastion(o)
+ testcode = """if 1:
b.add(81)
b.add(18)
print "b.total() =", b.total()
@@ -156,6 +157,20 @@ def _test():
print "inaccessible"
else:
print "accessible"
+ try:
+ print "b._get_.func_defaults =", b._get_.func_defaults,
+ except:
+ print "inaccessible"
+ else:
+ print "accessible"
+ \n"""
+ exec testcode
+ print '='*20, "Using rexec:", '='*20
+ import rexec
+ r = rexec.RExec()
+ m = r.add_module('__main__')
+ m.b = b
+ r.r_exec(testcode)
if __name__ == '__main__':