[Zope3-checkins] CVS: Zope3/src/zope/context/tests - test_wrapper.py:1.21

Anthony Baxter anthony@interlink.com.au
Sun, 13 Jul 2003 09:45:32 -0400


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

Modified Files:
	test_wrapper.py 
Log Message:
ContextMethod(ContextMethod(func)) would bomb out with a SystemError.
Fixed by applying the same patch that was applied to Python2.3's classmethod.
Also added a simple test. Note that if you've do a cvs up and get a failure,
make sure you've rebuilt the C code module in src/zope/context/wrapper.c


=== Zope3/src/zope/context/tests/test_wrapper.py 1.20 => 1.21 ===
--- Zope3/src/zope/context/tests/test_wrapper.py:1.20	Sat Jun  7 09:00:02 2003
+++ Zope3/src/zope/context/tests/test_wrapper.py	Sun Jul 13 09:45:26 2003
@@ -593,6 +593,13 @@
             b.append(x)
         self.assertEquals(a, b)
 
+    def test_descr_abuse(self):
+        def abuse():
+            def foo(): pass
+            ContextMethod(ContextMethod(foo)).__get__(1)
+	self.assertRaises(TypeError, abuse)
+	    
+
 
 class WrapperSubclass(wrapper.Wrapper):