[Zope-Checkins] CVS: Zope3/lib/python/Persistence/tests - testModule.py:1.7
Jeremy Hylton
jeremy@zope.com
Mon, 24 Jun 2002 16:06:52 -0400
Update of /cvs-repository/Zope3/lib/python/Persistence/tests
In directory cvs.zope.org:/tmp/cvs-serv12209/tests
Modified Files:
testModule.py
Log Message:
Fix access to builtin names
=== Zope3/lib/python/Persistence/tests/testModule.py 1.6 => 1.7 ===
return x
"""
+builtin_src = """x = 1, 2, 3
+def f():
+ return len(x)
+"""
class TestModule(unittest.TestCase):
@@ -111,6 +115,12 @@
get_transaction().commit()
effect.inc()
self.assert_(effect._p_changed)
+
+ def testBuiltins(self):
+ self.importer.module_from_source("test", builtin_src)
+ get_transaction().commit()
+ import test
+ self.assertEqual(test.f(), len(test.x))
def test_suite():
return unittest.makeSuite(TestModule)