[Zope3-checkins] CVS: Zope3/src/zope/proxy/tests - test_proxy.py:1.6

Steve Alexander steve@cat-box.net
Thu, 8 May 2003 05:40:12 -0400


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

Modified Files:
	test_proxy.py 
Log Message:
Factored out the class being tested into a member of the TestCase class.


=== Zope3/src/zope/proxy/tests/test_proxy.py 1.5 => 1.6 ===
--- Zope3/src/zope/proxy/tests/test_proxy.py:1.5	Wed Apr  9 08:50:31 2003
+++ Zope3/src/zope/proxy/tests/test_proxy.py	Thu May  8 05:40:11 2003
@@ -57,21 +57,24 @@
 
 
 class ProxyTestCase(unittest.TestCase):
+
+    proxy_class = proxy.proxy
+
     def setUp(self):
         self.x = Thing()
         self.p = self.new_proxy(self.x)
 
     def new_proxy(self, o):
-        return proxy.proxy(o)
+        return self.proxy_class(o)
 
     def test_constructor(self):
         o = object()
-        self.assertRaises(TypeError, proxy.proxy, o, o)
-        self.assertRaises(TypeError, proxy.proxy, o, key='value')
-        self.assertRaises(TypeError, proxy.proxy, key='value')
+        self.assertRaises(TypeError, self.proxy_class, o, o)
+        self.assertRaises(TypeError, self.proxy_class, o, key='value')
+        self.assertRaises(TypeError, self.proxy_class, key='value')
 
     def test_subclass_constructor(self):
-        class MyProxy(proxy.proxy):
+        class MyProxy(self.proxy_class):
             def __new__(cls, *args, **kwds):
                 return super(MyProxy, cls).__new__(cls, *args, **kwds)
             def __init__(self, *args, **kwds):
@@ -88,7 +91,7 @@
 
         # Check that are passed to __init__() overrides what's passed
         # to __new__().
-        class MyProxy2(proxy.proxy):
+        class MyProxy2(self.proxy_class):
             def __new__(cls, *args, **kwds):
                 return super(MyProxy2, cls).__new__(cls, 'value')