[Zope3-checkins] CVS: Zope3/lib/python/Persistence/tests - testModule.py:1.23

Jeremy Hylton jeremy@zope.com
Fri, 20 Sep 2002 16:34:48 -0400


Update of /cvs-repository/Zope3/lib/python/Persistence/tests
In directory cvs.zope.org:/tmp/cvs-serv17527

Modified Files:
	testModule.py 
Log Message:
Add test of package with __init__ that specifies a module.


=== Zope3/lib/python/Persistence/tests/testModule.py 1.22 => 1.23 ===
--- Zope3/lib/python/Persistence/tests/testModule.py:1.22	Fri Sep 20 16:09:39 2002
+++ Zope3/lib/python/Persistence/tests/testModule.py	Fri Sep 20 16:34:48 2002
@@ -301,7 +301,17 @@
         self.assert_(hasattr(A.B.D, "a"))
         self.assert_(hasattr(A.B.D, "b"))
         self.assert_(not hasattr(A.B.D, "c"))
-        
+
+        mgr = PersistentModuleManager(self.registry)
+        mgr.new("A.__init__", """__all__ = ["B", "F"]""")
+        get_transaction().commit()
+
+        mgr = PersistentModuleManager(self.registry)
+        mgr.new("A.F", "spam = 1")
+        get_transaction().commit()
+
+        import A
+        self.assertEqual(A.F.spam, 1)
 
 class TestModuleReload(unittest.TestCase):
     """Test reloading of modules"""