[Checkins] SVN: five.grok/trunk/src/five/grok/tests/adapters.py
improved adapter test
eric casteleijn
eric at infrae.com
Sat May 3 09:27:52 EDT 2008
Log message for revision 86208:
improved adapter test
Changed:
U five.grok/trunk/src/five/grok/tests/adapters.py
-=-
Modified: five.grok/trunk/src/five/grok/tests/adapters.py
===================================================================
--- five.grok/trunk/src/five/grok/tests/adapters.py 2008-05-03 13:25:02 UTC (rev 86207)
+++ five.grok/trunk/src/five/grok/tests/adapters.py 2008-05-03 13:27:51 UTC (rev 86208)
@@ -3,7 +3,13 @@
>>> from OFS.SimpleItem import SimpleItem
>>> item = SimpleItem()
>>> item.id = 'item'
- >>> IId(item).id()
+ >>> adapted = IId(item)
+ >>> isinstance(adapted, SimpleItemIdAdapter)
+ True
+ >>> IId.providedBy(adapted)
+ True
+
+ >>> adapted.id()
'item'
"""
@@ -17,8 +23,8 @@
"""Returns the ID of the object"""
class SimpleItemIdAdapter(grok.Adapter):
- grok.provides(IId)
+ grok.implements(IId)
grok.context(ISimpleItem)
-
+
def id(self):
return self.context.getId()
More information about the Checkins
mailing list