[Zope3-checkins] CVS: Zope3/src/zope/context/tests - test_ContextAware.py:1.4 test_wrapper.py:1.18 test_wrapperinteraction.py:1.6 test_ContextWrapper.py:NONE

Jim Fulton jim@zope.com
Sun, 1 Jun 2003 12:00:11 -0400


Update of /cvs-repository/Zope3/src/zope/context/tests
In directory cvs.zope.org:/tmp/cvs-serv25908/src/zope/context/tests

Modified Files:
	test_ContextAware.py test_wrapper.py 
	test_wrapperinteraction.py 
Removed Files:
	test_ContextWrapper.py 
Log Message:
Moved ContextWrapper, getItem, getAttr, queryItem, and queryAttr
from zope.context to zope.app.context.


=== Zope3/src/zope/context/tests/test_ContextAware.py 1.3 => 1.4 ===
--- Zope3/src/zope/context/tests/test_ContextAware.py:1.3	Tue May 27 10:18:30 2003
+++ Zope3/src/zope/context/tests/test_ContextAware.py	Sun Jun  1 11:59:40 2003
@@ -19,8 +19,8 @@
 """
 
 from unittest import TestCase, TestSuite, main, makeSuite
-from zope.context import ContextAware, ContextWrapper
-from zope.context import getWrapperContainer
+from zope.context import Wrapper
+from zope.context import ContextAware, getWrapperContainer
 
 def setter(self, v):
     self.v = getWrapperContainer(self), v
@@ -72,7 +72,7 @@
         self.assertEqual(b.v, (None, 1))
 
         # Check wrapper case
-        b = ContextWrapper(b, 42)
+        b = Wrapper(b, 42)
         self.assertEqual(b.p1B, 42)
         self.assertEqual(b.p2B, 42)
         self.assertEqual(b.fB(), 42)


=== Zope3/src/zope/context/tests/test_wrapper.py 1.17 => 1.18 ===
--- Zope3/src/zope/context/tests/test_wrapper.py:1.17	Thu May 29 14:53:44 2003
+++ Zope3/src/zope/context/tests/test_wrapper.py	Sun Jun  1 11:59:40 2003
@@ -18,7 +18,7 @@
 import unittest
 
 from zope.proxy import getProxiedObject
-from zope.context import ContextWrapper, wrapper
+from zope.context import Wrapper, wrapper
 from zope.context import ContextMethod, ContextProperty, ContextAware
 from zope.proxy.tests.test_proxy import Thing, ProxyTestCase
 
@@ -200,7 +200,7 @@
 
     def test_ContextAware_doesnt_mess_up___class__(self):
         class C(ContextAware): pass
-        self.assertEqual(ContextWrapper(C(), None).__class__, C)
+        self.assertEqual(Wrapper(C(), None).__class__, C)
 
     def test_ContextMethod_getattr(self):
         class Z(object):


=== Zope3/src/zope/context/tests/test_wrapperinteraction.py 1.5 => 1.6 ===
--- Zope3/src/zope/context/tests/test_wrapperinteraction.py:1.5	Tue May 27 10:18:30 2003
+++ Zope3/src/zope/context/tests/test_wrapperinteraction.py	Sun Jun  1 11:59:40 2003
@@ -11,11 +11,10 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""Testing the interaction of Wrapper, ContextWrapper, ContextMethod etc.
+"""Testing the interaction of Wrapper, ContextMethod etc.
 
 Testing the Wrapper type's interaction with ContextDescriptors such as
-ContextMethod and ContextProperty, and the ContextWrapper factory function
-that creates a wrapper object, and checks for misuse of ContextDescriptors
+ContextMethod and ContextProperty, and checks for misuse of ContextDescriptors
 as members of classic classes. (Descriptors generally don't work properly
 as members of classic classes.)
 
@@ -472,39 +471,12 @@
         self.assertEqual(wrapped[0], 23)
         self.assertEqual(wrapped.__getitem__(0), 23)
 
-class TestContextWrapperFactory(unittest.TestCase):
-
-    pass
-
-# XXX commented this test out because of Jim's change in
-# src/zope/context/__init__.py
-
-##     def testClassicClassWarning(self):
-##         from types import ClassType
-##         class Classic:
-##             __metaclass__ = ClassType
-##             def foo(self):
-##                 pass
-
-##         class BadClassic:
-##             __metaclass__ = ClassType
-##             def foo(self):
-##                 pass
-##             foo = ContextMethod(foo)
-
-##         # ok if there are no ContextDescriptors 
-##         w = ContextWrapper(Classic(), None)
-
-##         # raises if there is a ContextDescriptor
-##         self.assertRaises(TypeError, ContextWrapper, BadClassic(), None)
-
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(TestNewStyleClass),
         unittest.makeSuite(TestNewStyleClassWithSlots),
         unittest.makeSuite(TestClassicClass),
         unittest.makeSuite(TestWrapperOnObjectsWithDifferentSlots),
-        unittest.makeSuite(TestContextWrapperFactory),
         ))
 
 

=== Removed File Zope3/src/zope/context/tests/test_ContextWrapper.py ===