[Checkins] SVN: five.grokkers/trunk/five/grokkers/tests/ Utilities
work as well.
Lennart Regebro
regebro at gmail.com
Fri Apr 25 11:13:56 EDT 2008
Log message for revision 85722:
Utilities work as well.
Changed:
U five.grokkers/trunk/five/grokkers/tests/test_all.py
A five.grokkers/trunk/five/grokkers/tests/utilities.py
-=-
Modified: five.grokkers/trunk/five/grokkers/tests/test_all.py
===================================================================
--- five.grokkers/trunk/five/grokkers/tests/test_all.py 2008-04-25 14:55:30 UTC (rev 85721)
+++ five.grokkers/trunk/five/grokkers/tests/test_all.py 2008-04-25 15:13:56 UTC (rev 85722)
@@ -23,6 +23,9 @@
module='five.grokkers.tests.adapters',
setUp=setUp, tearDown=testing.tearDown),
+ doctestunit.DocTestSuite(
+ module='five.grokkers.tests.utilities',
+ setUp=setUp, tearDown=testing.tearDown),
# Integration tests that use ZopeTestCase
#ztc.ZopeDocFileSuite(
# 'README.txt', package='something.foo',
Added: five.grokkers/trunk/five/grokkers/tests/utilities.py
===================================================================
--- five.grokkers/trunk/five/grokkers/tests/utilities.py (rev 0)
+++ five.grokkers/trunk/five/grokkers/tests/utilities.py 2008-04-25 15:13:56 UTC (rev 85722)
@@ -0,0 +1,24 @@
+"""Testing that grokcore adapters work under Zope2
+
+ >>> from zope import component
+ >>> club = component.getUtility(IFiveClub, 'five_inch')
+ >>> IFiveClub.providedBy(club)
+ True
+ >>> isinstance(club, FiveInchClub)
+ True
+
+"""
+from zope.interface import Interface, implements
+from grokcore.component.components import Adapter, GlobalUtility
+from grokcore.component.directive import provides, name
+
+class IFiveClub(Interface):
+ pass
+
+class ITinyClub(Interface):
+ pass
+
+class FiveInchClub(GlobalUtility):
+ implements(IFiveClub, ITinyClub)
+ provides(IFiveClub)
+ name('five_inch')
Property changes on: five.grokkers/trunk/five/grokkers/tests/utilities.py
___________________________________________________________________
Name: svn:keywords
+ Id
More information about the Checkins
mailing list