[Zope3-checkins] CVS: Zope3/src/zope/app/component/tests - test_wrapper_hooks.py:1.1.2.6

Steve Alexander steve@cat-box.net
Fri, 16 May 2003 09:52:18 -0400


Update of /cvs-repository/Zope3/src/zope/app/component/tests
In directory cvs.zope.org:/tmp/cvs-serv14925/src/zope/app/component/tests

Modified Files:
      Tag: stevea-decorators-branch
	test_wrapper_hooks.py 
Log Message:
Corrected recently added XXX comment.
Now, an object that is not Proxied, but does have a __Security_checker__
attribute will be decorated with a __Security_checker__ attribute that
resolves to a decorated checker.


=== Zope3/src/zope/app/component/tests/test_wrapper_hooks.py 1.1.2.5 => 1.1.2.6 ===
--- Zope3/src/zope/app/component/tests/test_wrapper_hooks.py:1.1.2.5	Fri May 16 09:37:27 2003
+++ Zope3/src/zope/app/component/tests/test_wrapper_hooks.py	Fri May 16 09:52:18 2003
@@ -164,7 +164,20 @@
 
         spec.permissionMap = self.decorationGetMap
         spec.setPermissionMap = self.decorationSetMap
-        proxied_ob = ProxyFactory(SomeOtherObject())
+        ob = SomeOtherObject()
+        proxied_ob = ProxyFactory(ob)
+
+        d = decorate(spec, ob, parent, kw)
+        self.assert_(type(d) is Decorator)
+        self.checkingTestImpl(self.originalChecker, d.__Security_checker__)
+        # The next asserts are somewhat redundant, but serves to show that
+        # the checker has changed, and is not None.
+        self.assert_(d.__Security_checker__ is not
+                     SomeOtherObject.__Security_checker__)
+        self.assert_(d.__Security_checker__ is not None)
+
+        # a decorated proxy should be another decorated proxy, with a
+        # combined checker
         d = decorate(spec, proxied_ob, parent, kw)
         self.assert_(type(d) is Proxy)
         self.checkingTestImpl(self.originalChecker, getChecker(d))