[Zope-Checkins] CVS: Zope3/lib/python/Zope/ContextWrapper/tests - testSimpleMethodWrapper.py:1.1.2.2
Steve Alexander
steve@cat-box.net
Thu, 18 Apr 2002 04:41:57 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/ContextWrapper/tests
In directory cvs.zope.org:/tmp/cvs-serv25699/lib/python/Zope/ContextWrapper/tests
Modified Files:
Tag: Zope-3x-branch
testSimpleMethodWrapper.py
Log Message:
Added explanatory comment about from Zope.ContextWrapper import Wrapper
Changed "self" argument of ContextMethods to "wrapped_self"
=== Zope3/lib/python/Zope/ContextWrapper/tests/testSimpleMethodWrapper.py 1.1.2.1 => 1.1.2.2 ===
import unittest
+# Note that this is testing both that SimpleMethodWrapper works,
+# and that SimpleMethodWrapper is available as
+# from Zope.ContextWrapper import Wrapper
+#
+# However, this test suite can form the basis of a test for the improved C
+# implementation, when that lands.
+#
from Zope.ContextWrapper import Wrapper
from Zope.ContextWrapper import ContextMethod
class NewStyleClass(object):
- def thisIsAContextMethod(self):
- assert isinstance(self, Wrapper)
+ def thisIsAContextMethod(wrapped_self):
+ assert isinstance(wrapped_self, Wrapper)
thisIsAContextMethod = ContextMethod(thisIsAContextMethod)
@@ -30,8 +37,8 @@
class ClassicClass:
- def thisIsAContextMethod(self):
- assert isinstance(self, Wrapper)
+ def thisIsAContextMethod(wrapped_self):
+ assert isinstance(wrapped_self, Wrapper)
thisIsAContextMethod = ContextMethod(thisIsAContextMethod)