[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/component/ Now
subscription registrations are documented as well.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Wed Nov 9 14:54:29 EST 2005
Log message for revision 40007:
Now subscription registrations are documented as well.
Changed:
U Zope3/trunk/src/zope/app/component/metaconfigure.py
U Zope3/trunk/src/zope/app/component/tests/test_directives.py
-=-
Modified: Zope3/trunk/src/zope/app/component/metaconfigure.py
===================================================================
--- Zope3/trunk/src/zope/app/component/metaconfigure.py 2005-11-09 19:53:08 UTC (rev 40006)
+++ Zope3/trunk/src/zope/app/component/metaconfigure.py 2005-11-09 19:54:29 UTC (rev 40007)
@@ -120,7 +120,7 @@
discriminator = None,
callable = _handler,
args = ('subscribe',
- for_, provides, factory),
+ for_, provides, factory, _context.info),
)
if provides is not None:
Modified: Zope3/trunk/src/zope/app/component/tests/test_directives.py
===================================================================
--- Zope3/trunk/src/zope/app/component/tests/test_directives.py 2005-11-09 19:53:08 UTC (rev 40006)
+++ Zope3/trunk/src/zope/app/component/tests/test_directives.py 2005-11-09 19:54:29 UTC (rev 40007)
@@ -25,6 +25,7 @@
from zope.component.tests.request import Request
from zope.component import createObject
from zope.component.interfaces import IDefaultViewName
+from zope.component.site import SubscriptionRegistration
from zope.configuration.xmlconfig import xmlconfig, XMLConfig
from zope.configuration.exceptions import ConfigurationError
@@ -133,6 +134,26 @@
self.assertEqual(a3.context, (content, a1))
+ def testSubscriberDocumentation(self):
+ xmlconfig(StringIO(template % (
+ '''
+ <subscriber
+ provides="zope.app.component.tests.adapter.IS"
+ factory="zope.app.component.tests.adapter.A3"
+ for="zope.app.component.tests.components.IContent
+ zope.app.component.tests.adapter.I1"
+ />
+ '''
+ )))
+
+ gsm = zapi.getGlobalSiteManager()
+ doc = [reg.doc
+ for reg in gsm.registrations()
+ if (isinstance(reg, SubscriptionRegistration) and
+ reg.provided is IS)][0]
+
+ self.assertEqual(`doc`, 'File "<string>", line 6.12-11.16')
+
def testSubscriberWithPermission(self):
xmlconfig(StringIO(template % (
'''
More information about the Zope3-Checkins
mailing list