[Zope3-checkins] CVS: Zope3/lib/python/Persistence/tests - ATestModule.py:1.1 testpatch.py:1.2 TestModule.py:NONE

Jeremy Hylton jeremy@zope.com
Fri, 22 Nov 2002 10:01:10 -0500


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

Modified Files:
	testpatch.py 
Added Files:
	ATestModule.py 
Removed Files:
	TestModule.py 
Log Message:
Rename TestModule to ATestModule.

Repair accident where two modules had the same name except for case.


=== Added File Zope3/lib/python/Persistence/tests/ATestModule.py ===
"""A module used to test persistent module patching."""

def aFunc():
    def nestedFunc():
        return aFunc
    return 1

class Foo(object):
    def meth(self):
        return 0

    class Nested(object):
        def bar(self):
            return 1

class Bar:
    def bar(self, x):
        return 2 * x

    static = staticmethod(aFunc)
    alias = aFunc

    classbar = classmethod(bar)

def anotherFunc():
    class NotFound:
        pass


=== Zope3/lib/python/Persistence/tests/testpatch.py 1.1 => 1.2 ===
--- Zope3/lib/python/Persistence/tests/testpatch.py:1.1	Fri Nov 22 00:33:58 2002
+++ Zope3/lib/python/Persistence/tests/testpatch.py	Fri Nov 22 10:01:09 2002
@@ -1,12 +1,12 @@
 from Persistence.patch import NameFinder, convert
-from Persistence.tests import TestModule
+from Persistence.tests import ATestModule
 
 import unittest
 
 class TestNameFinder(unittest.TestCase):
 
     def testNameFinder(self):
-        nf = NameFinder(TestModule)
+        nf = NameFinder(ATestModule)
         names = nf.names()
         for name in ("Foo", "Bar", "aFunc", "anotherFunc",
                      "Foo.meth", "Foo.Nested", "Bar.bar",
@@ -18,9 +18,9 @@
 class TestPatch(unittest.TestCase):
 
     def testPatch(self):
-        moddict = TestModule.__dict__
-        convert(TestModule, {})
-        newdict = TestModule.__dict__
+        moddict = ATestModule.__dict__
+        convert(ATestModule, {})
+        newdict = ATestModule.__dict__
         
         L1 = moddict.keys()
         L2 = newdict.keys()
@@ -28,7 +28,7 @@
         L2.sort()
         self.assertEqual(L1, L2)
 
-        self.assertEqual(TestModule.__dict__, TestModule.aFunc.func_globals)
+        self.assertEqual(ATestModule.__dict__, ATestModule.aFunc.func_globals)
 
 def test_suite():
     s = unittest.TestSuite()

=== Removed File Zope3/lib/python/Persistence/tests/TestModule.py ===