[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/apidoc/
apidoc/tests.py tests all working again
Dmitry Vasiliev
dima at hlabs.spb.ru
Tue Jul 27 04:12:32 EDT 2004
Log message for revision 26777:
apidoc/tests.py tests all working again
Changed:
U Zope3/trunk/src/zope/app/apidoc/__init__.py
U Zope3/trunk/src/zope/app/apidoc/browser/apidoc.py
U Zope3/trunk/src/zope/app/apidoc/tests.py
-=-
Modified: Zope3/trunk/src/zope/app/apidoc/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/__init__.py 2004-07-27 07:41:49 UTC (rev 26776)
+++ Zope3/trunk/src/zope/app/apidoc/__init__.py 2004-07-27 08:12:32 UTC (rev 26777)
@@ -37,7 +37,7 @@
>>> doc = APIDocumentation(None, '++apidoc++')
>>> doc.get('ZCML').title
- 'ZCML Reference'
+ u'ZCML Reference'
>>> doc.get('Documentation') is None
True
@@ -55,7 +55,7 @@
def get(self, key, default=None):
"""See zope.app.container.interfaces.IReadContainer"""
- utility = zapi.queryUtility(IDocumentationModule, key, default, self)
+ utility = zapi.queryUtility(IDocumentationModule, key, default)
if utility != default:
locate(utility, self, key)
return utility
Modified: Zope3/trunk/src/zope/app/apidoc/browser/apidoc.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/apidoc.py 2004-07-27 07:41:49 UTC (rev 26776)
+++ Zope3/trunk/src/zope/app/apidoc/browser/apidoc.py 2004-07-27 08:12:32 UTC (rev 26777)
@@ -34,7 +34,7 @@
>>> info = view.getModuleList()
>>> info = [(i['name'], i['title']) for i in info]
>>> print info
- [('Interface', 'Interfaces'), ('ZCML', 'ZCML Reference')]
+ [(u'Interface', u'Interfaces'), (u'ZCML', u'ZCML Reference')]
"""
items = list(self.context.items())
items.sort()
Modified: Zope3/trunk/src/zope/app/apidoc/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/tests.py 2004-07-27 07:41:49 UTC (rev 26776)
+++ Zope3/trunk/src/zope/app/apidoc/tests.py 2004-07-27 08:12:32 UTC (rev 26777)
@@ -17,24 +17,34 @@
"""
from pprint import PrettyPrinter
import unittest
-from zope.app import zapi
+
+from zope.component.interfaces import IFactory
from zope.app.traversing.interfaces import IContainmentRoot
from zope.app.location import LocationProxy
-from zope.app.tests import placelesssetup
+from zope.app.tests import placelesssetup, ztapi
from zope.interface import implements
from zope.app.apidoc.interfaces import IDocumentationModule
from zope.app.apidoc.ifacemodule import InterfaceModule
from zope.app.apidoc.zcmlmodule import ZCMLModule
from zope.testing.doctestunit import DocTestSuite
+from zope.app.renderer.rest import ReStructuredTextSourceFactory
+from zope.app.renderer.rest import IReStructuredTextSource
+from zope.app.renderer.rest import ReStructuredTextToHTMLRenderer
+
def setUp():
placelesssetup.setUp()
- service = zapi.getGlobalService('Utilities')
- service.provideUtility(IDocumentationModule, InterfaceModule(),
+ ztapi.provideUtility(IDocumentationModule, InterfaceModule(),
'Interface')
- service.provideUtility(IDocumentationModule, ZCMLModule(), 'ZCML')
+ ztapi.provideUtility(IDocumentationModule, ZCMLModule(), 'ZCML')
+ # Register Renderer Components
+ ztapi.provideUtility(IFactory, ReStructuredTextSourceFactory,
+ 'zope.source.rest')
+ ztapi.browserView(IReStructuredTextSource, '',
+ ReStructuredTextToHTMLRenderer)
+
def tearDown():
placelesssetup.tearDown()
@@ -97,10 +107,10 @@
def test_suite():
return unittest.TestSuite((
- #DocTestSuite('zope.app.apidoc',
- # setUp=setUp, tearDown=tearDown),
- #DocTestSuite('zope.app.apidoc.browser.apidoc',
- # setUp=setUp, tearDown=tearDown),
+ DocTestSuite('zope.app.apidoc',
+ setUp=setUp, tearDown=tearDown),
+ DocTestSuite('zope.app.apidoc.browser.apidoc',
+ setUp=setUp, tearDown=tearDown),
DocTestSuite('zope.app.apidoc.utilities'),
DocTestSuite('zope.app.apidoc.tests'),
))
More information about the Zope3-Checkins
mailing list