[Zope3-checkins] CVS: Zope3/src/zope/proxy/context/tests - test_wrapper.py:1.11
Steve Alexander
steve@cat-box.net
Thu, 8 May 2003 05:40:41 -0400
Update of /cvs-repository/Zope3/src/zope/proxy/context/tests
In directory cvs.zope.org:/tmp/cvs-serv8339/src/zope/proxy/context/tests
Modified Files:
test_wrapper.py
Log Message:
Factored out the class being tested into a member of the TestCase class.
=== Zope3/src/zope/proxy/context/tests/test_wrapper.py 1.10 => 1.11 ===
--- Zope3/src/zope/proxy/context/tests/test_wrapper.py:1.10 Wed May 7 05:32:59 2003
+++ Zope3/src/zope/proxy/context/tests/test_wrapper.py Thu May 8 05:40:11 2003
@@ -25,8 +25,10 @@
class WrapperTestCase(ProxyTestCase):
+ proxy_class = wrapper.Wrapper
+
def new_proxy(self, o, c=None):
- return wrapper.Wrapper(o, c)
+ return self.proxy_class(o, c)
def test_constructor(self):
o1 = object()
@@ -37,7 +39,7 @@
self.assert_(wrapper.getcontext(w) is o3)
def test_subclass_constructor(self):
- class MyWrapper(wrapper.Wrapper):
+ class MyWrapper(self.proxy_class):
def __init__(self, *args, **kwds):
super(MyWrapper, self).__init__('foo', **kwds)
@@ -73,7 +75,7 @@
self.assert_(wrapper.getcontext(w) is c)
def test_wrapper_subclass_attributes(self):
- class MyWrapper(wrapper.Wrapper):
+ class MyWrapper(self.proxy_class):
def __init__(self, ob):
super(MyWrapper, self).__init__(ob)
self.foo = 1
@@ -471,7 +473,7 @@
self.assert_(wrapper.getdictcreate(w) is d)
self.assert_(wrapper.getdict(w) is d)
- w = wrapper.Wrapper(None, name="myobject")
+ w = self.proxy_class(None, name="myobject")
d = wrapper.getdict(w)
self.assert_(d is not None)
self.assert_(wrapper.getdictcreate(w) is d)