[Zope3-checkins] CVS: Zope3/src/zope/app/utilities/tests -
test_wrapper.py:1.2
Sidnei da Silva
cvs-admin at zope.org
Mon Nov 24 12:37:39 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/utilities/tests
In directory cvs.zope.org:/tmp/cvs-serv15984/src/zope/app/utilities/tests
Modified Files:
test_wrapper.py
Log Message:
Fix descriptor handling inside the persistent wrapper. Also add a test to confirm that it works
=== Zope3/src/zope/app/utilities/tests/test_wrapper.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/utilities/tests/test_wrapper.py:1.1 Sat Oct 18 14:56:24 2003
+++ Zope3/src/zope/app/utilities/tests/test_wrapper.py Mon Nov 24 12:37:38 2003
@@ -16,9 +16,14 @@
from persistence import Persistent, PersistentMetaClass
from persistence.tests.test_persistence import DM as BaseDM, BrokenDM
+from zope.interface import Interface, directlyProvides, directlyProvidedBy
+
from zope.app.utilities.wrapper import Struct
from zope.app.container.contained import ContainedProxy, getProxiedObject
+
+class IDummy(Interface): pass
+
class Dummy(object):
def __init__(self, x=0):
@@ -334,6 +339,13 @@
self.failUnless(pb.__dict__.has_key('__proxied__'))
self.assertEqual(pb.__dict__['__proxied__'].__dict__,
pa.__dict__['__proxied__'].__dict__)
+
+ def testDirectlyProvides(self):
+ p = self.klass()
+ self.failIf(IDummy.isImplementedBy(p))
+ directlyProvides(p, directlyProvidedBy(p), IDummy)
+ self.failUnless(IDummy.isImplementedBy(p))
+
def test_suite():
s = unittest.TestSuite()
More information about the Zope3-Checkins
mailing list