[Checkins] SVN: zope.app.apidoc/trunk/src/zope/app/apidoc/ Moved
all functional tests to tests.py files, so that the KGS test
Stephan Richter
srichter at cosmos.phy.tufts.edu
Wed Oct 10 23:13:44 EDT 2007
Log message for revision 80813:
Moved all functional tests to tests.py files, so that the KGS test
runner picks them up.
Changed:
D zope.app.apidoc/trunk/src/zope/app/apidoc/browser/ftests.py
A zope.app.apidoc/trunk/src/zope/app/apidoc/browser/tests.py
D zope.app.apidoc/trunk/src/zope/app/apidoc/codemodule/browser/ftests.py
U zope.app.apidoc/trunk/src/zope/app/apidoc/codemodule/browser/tests.py
D zope.app.apidoc/trunk/src/zope/app/apidoc/ifacemodule/ftests.py
U zope.app.apidoc/trunk/src/zope/app/apidoc/ifacemodule/tests.py
D zope.app.apidoc/trunk/src/zope/app/apidoc/utilitymodule/ftests.py
U zope.app.apidoc/trunk/src/zope/app/apidoc/utilitymodule/tests.py
D zope.app.apidoc/trunk/src/zope/app/apidoc/zcmlmodule/ftests.py
U zope.app.apidoc/trunk/src/zope/app/apidoc/zcmlmodule/tests.py
-=-
Deleted: zope.app.apidoc/trunk/src/zope/app/apidoc/browser/ftests.py
===================================================================
--- zope.app.apidoc/trunk/src/zope/app/apidoc/browser/ftests.py 2007-10-11 02:52:30 UTC (rev 80812)
+++ zope.app.apidoc/trunk/src/zope/app/apidoc/browser/ftests.py 2007-10-11 03:13:44 UTC (rev 80813)
@@ -1,92 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2003, 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Functional Tests for API Documentation.
-
-$Id$
-"""
-import re
-import unittest
-
-import zope.app.testing.functional
-from zope.testing import doctest
-from zope.testing import renormalizing
-from zope.app.testing.functional import BrowserTestCase, FunctionalNoDevMode
-from zope.app.testing.functional import FunctionalDocFileSuite
-from zope.app.apidoc.testing import APIDocLayer, APIDocNoDevModeLayer
-
-class APIDocTests(BrowserTestCase):
- """Just a couple of tests ensuring that the templates render."""
-
- def testMenu(self):
- response = self.publish('/++apidoc++/menu.html',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(body.find('Click on one of the Documentation') > 0)
- self.checkForBrokenLinks(body, '/++apidoc++/menu.html',
- basic='mgr:mgrpw')
-
- def testIndexView(self):
- response = self.publish('/++apidoc++/index.html',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(body.find('Zope 3 API Documentation') > 0)
- self.checkForBrokenLinks(body, '/++apidoc++/index.html',
- basic='mgr:mgrpw')
-
- def testContentsView(self):
- response = self.publish('/++apidoc++/contents.html',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(body.find('<h1>Zope 3 API Documentation</h1>') > 0)
- self.checkForBrokenLinks(body, '/++apidoc++/contents.html',
- basic='mgr:mgrpw')
-
- def testModuleListView(self):
- response = self.publish('/++apidoc++/modulelist.html',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(body.find(
- '<a href="contents.html" target="main">Zope') > 0)
- self.checkForBrokenLinks(body, '/++apidoc++/modulelist.html',
- basic='mgr:mgrpw')
-
-checker = renormalizing.RENormalizing([
- (re.compile(r'httperror_seek_wrapper:', re.M), 'HTTPError:'),
- ])
-
-def test_suite():
- suite = unittest.TestSuite()
- APIDocTests.layer = APIDocLayer
- suite.addTest(unittest.makeSuite(APIDocTests))
- apidoc_doctest = FunctionalDocFileSuite(
- "README.txt",
- optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE,
- checker=checker)
- apidoc_doctest.layer = APIDocLayer
- suite.addTest(
- apidoc_doctest,
- )
-
- nodevmode = FunctionalDocFileSuite("nodevmode.txt")
- nodevmode.layer = APIDocNoDevModeLayer
- suite.addTest(nodevmode)
- return suite
-
-
-if __name__ == '__main__':
- unittest.main(defaultTest='test_suite')
Copied: zope.app.apidoc/trunk/src/zope/app/apidoc/browser/tests.py (from rev 80811, zope.app.apidoc/trunk/src/zope/app/apidoc/browser/ftests.py)
===================================================================
--- zope.app.apidoc/trunk/src/zope/app/apidoc/browser/tests.py (rev 0)
+++ zope.app.apidoc/trunk/src/zope/app/apidoc/browser/tests.py 2007-10-11 03:13:44 UTC (rev 80813)
@@ -0,0 +1,92 @@
+##############################################################################
+#
+# Copyright (c) 2003, 2004 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Functional Tests for API Documentation.
+
+$Id$
+"""
+import re
+import unittest
+
+import zope.app.testing.functional
+from zope.testing import doctest
+from zope.testing import renormalizing
+from zope.app.testing.functional import BrowserTestCase, FunctionalNoDevMode
+from zope.app.testing.functional import FunctionalDocFileSuite
+from zope.app.apidoc.testing import APIDocLayer, APIDocNoDevModeLayer
+
+class APIDocTests(BrowserTestCase):
+ """Just a couple of tests ensuring that the templates render."""
+
+ def testMenu(self):
+ response = self.publish('/++apidoc++/menu.html',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(body.find('Click on one of the Documentation') > 0)
+ self.checkForBrokenLinks(body, '/++apidoc++/menu.html',
+ basic='mgr:mgrpw')
+
+ def testIndexView(self):
+ response = self.publish('/++apidoc++/index.html',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(body.find('Zope 3 API Documentation') > 0)
+ self.checkForBrokenLinks(body, '/++apidoc++/index.html',
+ basic='mgr:mgrpw')
+
+ def testContentsView(self):
+ response = self.publish('/++apidoc++/contents.html',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(body.find('<h1>Zope 3 API Documentation</h1>') > 0)
+ self.checkForBrokenLinks(body, '/++apidoc++/contents.html',
+ basic='mgr:mgrpw')
+
+ def testModuleListView(self):
+ response = self.publish('/++apidoc++/modulelist.html',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(body.find(
+ '<a href="contents.html" target="main">Zope') > 0)
+ self.checkForBrokenLinks(body, '/++apidoc++/modulelist.html',
+ basic='mgr:mgrpw')
+
+checker = renormalizing.RENormalizing([
+ (re.compile(r'httperror_seek_wrapper:', re.M), 'HTTPError:'),
+ ])
+
+def test_suite():
+ suite = unittest.TestSuite()
+ APIDocTests.layer = APIDocLayer
+ suite.addTest(unittest.makeSuite(APIDocTests))
+ apidoc_doctest = FunctionalDocFileSuite(
+ "README.txt",
+ optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE,
+ checker=checker)
+ apidoc_doctest.layer = APIDocLayer
+ suite.addTest(
+ apidoc_doctest,
+ )
+
+ nodevmode = FunctionalDocFileSuite("nodevmode.txt")
+ nodevmode.layer = APIDocNoDevModeLayer
+ suite.addTest(nodevmode)
+ return suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')
Deleted: zope.app.apidoc/trunk/src/zope/app/apidoc/codemodule/browser/ftests.py
===================================================================
--- zope.app.apidoc/trunk/src/zope/app/apidoc/codemodule/browser/ftests.py 2007-10-11 02:52:30 UTC (rev 80812)
+++ zope.app.apidoc/trunk/src/zope/app/apidoc/codemodule/browser/ftests.py 2007-10-11 03:13:44 UTC (rev 80813)
@@ -1,112 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2003, 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Functional Tests for Code Documentation Module.
-
-$Id$
-"""
-import unittest
-
-from zope.testing import doctest
-from zope.app.testing.functional import BrowserTestCase
-from zope.app.testing.functional import FunctionalDocFileSuite
-from zope.app.apidoc.testing import APIDocLayer
-
-class CodeModuleTests(BrowserTestCase):
- """Just a couple of tests ensuring that the templates render."""
-
- def testMenu(self):
- response = self.publish('/++apidoc++/Code/menu.html',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(body.find('Zope Source') > 0)
- self.checkForBrokenLinks(body, '/++apidoc++/Code/menu.html',
- basic='mgr:mgrpw')
-
- def testMenuCodeFinder(self):
- response = self.publish('/++apidoc++/Code/menu.html',
- basic='mgr:mgrpw',
- form={'path': 'Code', 'SUBMIT': 'Find'})
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(
- body.find('zope.app.apidoc.codemodule.codemodule.CodeModule') > 0)
- self.checkForBrokenLinks(body, '/++apidoc++/Code/menu.html',
- basic='mgr:mgrpw')
-
- def testModuleDetailsView(self):
- response = self.publish('/++apidoc++/Code/zope/app/apidoc/apidoc',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(body.find('Zope 3 API Documentation') > 0)
- self.checkForBrokenLinks(
- body, '/++apidoc++/Code/zope/app/apidoc/apidoc', basic='mgr:mgrpw')
-
- def testClassDetailsView(self):
- response = self.publish(
- '/++apidoc++/Code/zope/app/apidoc/apidoc/APIDocumentation',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(body.find('Represent the complete API Documentation.') > 0)
- self.checkForBrokenLinks(
- body, '/++apidoc++/Code/zope/app/apidoc/apidoc/APIDocumentation',
- basic='mgr:mgrpw')
-
- def testFunctionDetailsView(self):
- response = self.publish(
- '/++apidoc++/Code/zope/app/apidoc/apidoc/handleNamespace',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(body.find('handleNamespace(ob, name)') > 0)
- self.checkForBrokenLinks(
- body, '/++apidoc++/Code/zope/app/apidoc/apidoc/handleNamesapce',
- basic='mgr:mgrpw')
-
- def testTextFileDetailsView(self):
- response = self.publish(
- '/++apidoc++/Code/zope/app/apidoc/README.txt/index.html',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.checkForBrokenLinks(
- body, '/++apidoc++/Code/zope/app/apidoc/README.txt/index.html',
- basic='mgr:mgrpw')
-
- def testZCMLFileDetailsView(self):
- response = self.publish(
- '/++apidoc++/Code/zope/app/apidoc/configure.zcml/index.html',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.checkForBrokenLinks(
- body, '/++apidoc++/Code/zope/app/apidoc/configure.zcml/index.html',
- basic='mgr:mgrpw')
-
-
-def test_suite():
- CodeModuleTests.layer = APIDocLayer
- introspector = FunctionalDocFileSuite(
- "introspector.txt",
- optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE)
- introspector.layer = APIDocLayer
- return unittest.TestSuite((
- unittest.makeSuite(CodeModuleTests),
- introspector,
- ))
-
-if __name__ == '__main__':
- unittest.main(defaultTest='test_suite')
Modified: zope.app.apidoc/trunk/src/zope/app/apidoc/codemodule/browser/tests.py
===================================================================
--- zope.app.apidoc/trunk/src/zope/app/apidoc/codemodule/browser/tests.py 2007-10-11 02:52:30 UTC (rev 80812)
+++ zope.app.apidoc/trunk/src/zope/app/apidoc/codemodule/browser/tests.py 2007-10-11 03:13:44 UTC (rev 80813)
@@ -30,10 +30,13 @@
from zope.app.renderer.rest import IReStructuredTextSource
from zope.app.renderer.rest import ReStructuredTextToHTMLRenderer
from zope.app.testing import placelesssetup, setup, ztapi
+from zope.app.testing.functional import BrowserTestCase
+from zope.app.testing.functional import FunctionalDocFileSuite
from zope.app.apidoc.interfaces import IDocumentationModule
from zope.app.apidoc.codemodule.interfaces import IAPIDocRootModule
from zope.app.apidoc.codemodule.codemodule import CodeModule
+from zope.app.apidoc.testing import APIDocLayer
from zope.app.apidoc.zcmlmodule import ZCMLModule
# Just for loading purposes
@@ -43,6 +46,7 @@
import zope.app.apidoc.codemodule.browser.text
import zope.app.apidoc.codemodule.browser.zcml
+
def foo(cls, bar=1, *args):
"""This is the foo function."""
foo.deprecated = True
@@ -125,10 +129,90 @@
zope.app.appsetup.appsetup.__config_source = old_source_file
+class CodeModuleTests(BrowserTestCase):
+ """Just a couple of tests ensuring that the templates render."""
+
+ def testMenu(self):
+ response = self.publish('/++apidoc++/Code/menu.html',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(body.find('Zope Source') > 0)
+ self.checkForBrokenLinks(body, '/++apidoc++/Code/menu.html',
+ basic='mgr:mgrpw')
+
+ def testMenuCodeFinder(self):
+ response = self.publish('/++apidoc++/Code/menu.html',
+ basic='mgr:mgrpw',
+ form={'path': 'Code', 'SUBMIT': 'Find'})
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(
+ body.find('zope.app.apidoc.codemodule.codemodule.CodeModule') > 0)
+ self.checkForBrokenLinks(body, '/++apidoc++/Code/menu.html',
+ basic='mgr:mgrpw')
+
+ def testModuleDetailsView(self):
+ response = self.publish('/++apidoc++/Code/zope/app/apidoc/apidoc',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(body.find('Zope 3 API Documentation') > 0)
+ self.checkForBrokenLinks(
+ body, '/++apidoc++/Code/zope/app/apidoc/apidoc', basic='mgr:mgrpw')
+
+ def testClassDetailsView(self):
+ response = self.publish(
+ '/++apidoc++/Code/zope/app/apidoc/apidoc/APIDocumentation',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(body.find('Represent the complete API Documentation.') > 0)
+ self.checkForBrokenLinks(
+ body, '/++apidoc++/Code/zope/app/apidoc/apidoc/APIDocumentation',
+ basic='mgr:mgrpw')
+
+ def testFunctionDetailsView(self):
+ response = self.publish(
+ '/++apidoc++/Code/zope/app/apidoc/apidoc/handleNamespace',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(body.find('handleNamespace(ob, name)') > 0)
+ self.checkForBrokenLinks(
+ body, '/++apidoc++/Code/zope/app/apidoc/apidoc/handleNamesapce',
+ basic='mgr:mgrpw')
+
+ def testTextFileDetailsView(self):
+ response = self.publish(
+ '/++apidoc++/Code/zope/app/apidoc/README.txt/index.html',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.checkForBrokenLinks(
+ body, '/++apidoc++/Code/zope/app/apidoc/README.txt/index.html',
+ basic='mgr:mgrpw')
+
+ def testZCMLFileDetailsView(self):
+ response = self.publish(
+ '/++apidoc++/Code/zope/app/apidoc/configure.zcml/index.html',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.checkForBrokenLinks(
+ body, '/++apidoc++/Code/zope/app/apidoc/configure.zcml/index.html',
+ basic='mgr:mgrpw')
+
+
def test_suite():
checker = renormalizing.RENormalizing([
(re.compile(r" with base 10: 'text'"), r': text'),
])
+ CodeModuleTests.layer = APIDocLayer
+ introspector = FunctionalDocFileSuite(
+ "introspector.txt",
+ optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE)
+ introspector.layer = APIDocLayer
return unittest.TestSuite((
doctest.DocFileSuite(
'README.txt',
@@ -140,6 +224,8 @@
setUp=setUp, tearDown=tearDown,
globs={'pprint': doctestunit.pprint},
optionflags=doctest.NORMALIZE_WHITESPACE),
+ unittest.makeSuite(CodeModuleTests),
+ introspector,
))
if __name__ == '__main__':
Deleted: zope.app.apidoc/trunk/src/zope/app/apidoc/ifacemodule/ftests.py
===================================================================
--- zope.app.apidoc/trunk/src/zope/app/apidoc/ifacemodule/ftests.py 2007-10-11 02:52:30 UTC (rev 80812)
+++ zope.app.apidoc/trunk/src/zope/app/apidoc/ifacemodule/ftests.py 2007-10-11 03:13:44 UTC (rev 80813)
@@ -1,62 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2003, 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Functional Tests for Interface Documentation Module.
-
-$Id$
-"""
-import unittest
-from zope.app.testing.functional import BrowserTestCase
-from zope.app.apidoc.testing import APIDocLayer
-
-class InterfaceModuleTests(BrowserTestCase):
- """Just a couple of tests ensuring that the templates render."""
-
- def testMenu(self):
- response = self.publish(
- '/++apidoc++/Interface/menu.html',
- basic='mgr:mgrpw',
- env = {'name_only': True, 'search_str': 'IDoc'})
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(body.find(
- 'zope.app.apidoc.interfaces.IDocumentationModule') > 0)
- self.checkForBrokenLinks(body, '/++apidoc++/Interface/menu.html',
- basic='mgr:mgrpw')
-
- def testInterfaceDetailsView(self):
- response = self.publish(
- '/++apidoc++/Interface'
- '/zope.app.apidoc.ifacemodule.ifacemodule.IInterfaceModule'
- '/index.html',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(body.find('Interface API Documentation Module') > 0)
- self.checkForBrokenLinks(
- body,
- '/++apidoc++/Interface'
- '/zope.app.apidoc.ifacemodule.IInterfaceModule'
- '/index.html',
- basic='mgr:mgrpw')
-
-
-
-def test_suite():
- InterfaceModuleTests.layer = APIDocLayer
- return unittest.TestSuite((
- unittest.makeSuite(InterfaceModuleTests),
- ))
-
-if __name__ == '__main__':
- unittest.main(defaultTest='test_suite')
Modified: zope.app.apidoc/trunk/src/zope/app/apidoc/ifacemodule/tests.py
===================================================================
--- zope.app.apidoc/trunk/src/zope/app/apidoc/ifacemodule/tests.py 2007-10-11 02:52:30 UTC (rev 80812)
+++ zope.app.apidoc/trunk/src/zope/app/apidoc/ifacemodule/tests.py 2007-10-11 03:13:44 UTC (rev 80813)
@@ -21,30 +21,65 @@
from zope.interface.interfaces import IInterface
from zope.testing import doctest, doctestunit
+from zope.app.apidoc.testing import APIDocLayer
from zope.app.renderer.rest import ReStructuredTextSourceFactory
from zope.app.renderer.rest import IReStructuredTextSource
from zope.app.renderer.rest import ReStructuredTextToHTMLRenderer
from zope.app.testing import placelesssetup, ztapi, setup
+from zope.app.testing.functional import BrowserTestCase
from zope.app.tree.interfaces import IUniqueId
-from zope.app.tree.adapters import LocationUniqueId
+from zope.app.tree.adapters import LocationUniqueId
def setUp(test):
placelesssetup.setUp()
setup.setUpTraversal()
-
+
ztapi.provideAdapter(IInterface, IUniqueId, LocationUniqueId)
# Register Renderer Components
ztapi.provideUtility(IFactory, ReStructuredTextSourceFactory,
- 'zope.source.rest')
- ztapi.browserView(IReStructuredTextSource, '',
+ 'zope.source.rest')
+ ztapi.browserView(IReStructuredTextSource, '',
ReStructuredTextToHTMLRenderer)
# Cheat and register the ReST factory for STX as well
ztapi.provideUtility(IFactory, ReStructuredTextSourceFactory,
- 'zope.source.stx')
+ 'zope.source.stx')
-
+
+class InterfaceModuleTests(BrowserTestCase):
+ """Just a couple of tests ensuring that the templates render."""
+
+ def testMenu(self):
+ response = self.publish(
+ '/++apidoc++/Interface/menu.html',
+ basic='mgr:mgrpw',
+ env = {'name_only': True, 'search_str': 'IDoc'})
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(body.find(
+ 'zope.app.apidoc.interfaces.IDocumentationModule') > 0)
+ self.checkForBrokenLinks(body, '/++apidoc++/Interface/menu.html',
+ basic='mgr:mgrpw')
+
+ def testInterfaceDetailsView(self):
+ response = self.publish(
+ '/++apidoc++/Interface'
+ '/zope.app.apidoc.ifacemodule.ifacemodule.IInterfaceModule'
+ '/index.html',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(body.find('Interface API Documentation Module') > 0)
+ self.checkForBrokenLinks(
+ body,
+ '/++apidoc++/Interface'
+ '/zope.app.apidoc.ifacemodule.IInterfaceModule'
+ '/index.html',
+ basic='mgr:mgrpw')
+
+
def test_suite():
+ InterfaceModuleTests.layer = APIDocLayer
return unittest.TestSuite((
doctest.DocFileSuite('README.txt',
setUp=setUp, tearDown=placelesssetup.tearDown,
@@ -54,6 +89,7 @@
setUp=setUp, tearDown=placelesssetup.tearDown,
globs={'pprint': doctestunit.pprint},
optionflags=doctest.NORMALIZE_WHITESPACE),
+ unittest.makeSuite(InterfaceModuleTests),
))
if __name__ == '__main__':
Deleted: zope.app.apidoc/trunk/src/zope/app/apidoc/utilitymodule/ftests.py
===================================================================
--- zope.app.apidoc/trunk/src/zope/app/apidoc/utilitymodule/ftests.py 2007-10-11 02:52:30 UTC (rev 80812)
+++ zope.app.apidoc/trunk/src/zope/app/apidoc/utilitymodule/ftests.py 2007-10-11 03:13:44 UTC (rev 80813)
@@ -1,69 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2003, 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Functional Tests for Utility Documentation Module.
-
-$Id$
-"""
-import zope.deprecation
-import unittest
-from zope.app.testing.functional import BrowserTestCase
-from zope.app.apidoc.testing import APIDocLayer
-
-class UtilityModuleTests(BrowserTestCase):
- """Just a couple of tests ensuring that the templates render."""
-
- def testMenu(self):
- response = self.publish(
- '/++apidoc++/Utility/menu.html',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(body.find('IDocumentationModule') > 0)
-
- # BBB 2006/02/18, to be removed after 12 months
- # this avoids the deprecation warning for the deprecated
- # zope.publisher.interfaces.ILayer interface which get traversed
- # as a utility in this test
- zope.deprecation.__show__.off()
- self.checkForBrokenLinks(body, '/++apidoc++/Utility/menu.html',
- basic='mgr:mgrpw')
- zope.deprecation.__show__.on()
-
- def testUtilityDetailsView(self):
- response = self.publish(
- '/++apidoc++/Utility/'
- 'zope.app.apidoc.interfaces.IDocumentationModule/'
- 'Utility/index.html',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(
- body.find(
- 'zope.app.apidoc.utilitymodule.utilitymodule.UtilityModule') > 0)
- self.checkForBrokenLinks(
- body,
- '/++apidoc++/Utility/'
- 'zope.app.apidoc.interfaces.IDocumentationModule/'
- 'Utility/index.html',
- basic='mgr:mgrpw')
-
-
-def test_suite():
- UtilityModuleTests.layer = APIDocLayer
- return unittest.TestSuite((
- unittest.makeSuite(UtilityModuleTests),
- ))
-
-if __name__ == '__main__':
- unittest.main(defaultTest='test_suite')
Modified: zope.app.apidoc/trunk/src/zope/app/apidoc/utilitymodule/tests.py
===================================================================
--- zope.app.apidoc/trunk/src/zope/app/apidoc/utilitymodule/tests.py 2007-10-11 02:52:30 UTC (rev 80812)
+++ zope.app.apidoc/trunk/src/zope/app/apidoc/utilitymodule/tests.py 2007-10-11 03:13:44 UTC (rev 80813)
@@ -16,13 +16,16 @@
$Id$
"""
import unittest
+import zope.deprecation
from zope.testing import doctest, doctestunit
from zope.traversing.interfaces import IPhysicallyLocatable
from zope.location.traversing import LocationPhysicallyLocatable
+from zope.app.apidoc.testing import APIDocLayer
from zope.app.testing import placelesssetup, ztapi
+from zope.app.testing.functional import BrowserTestCase
from zope.app.tree.interfaces import IUniqueId
-from zope.app.tree.adapters import LocationUniqueId
+from zope.app.tree.adapters import LocationUniqueId
def setUp(test):
placelesssetup.setUp()
@@ -32,7 +35,47 @@
LocationPhysicallyLocatable)
+class UtilityModuleTests(BrowserTestCase):
+ """Just a couple of tests ensuring that the templates render."""
+
+ def testMenu(self):
+ response = self.publish(
+ '/++apidoc++/Utility/menu.html',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(body.find('IDocumentationModule') > 0)
+
+ # BBB 2006/02/18, to be removed after 12 months
+ # this avoids the deprecation warning for the deprecated
+ # zope.publisher.interfaces.ILayer interface which get traversed
+ # as a utility in this test
+ zope.deprecation.__show__.off()
+ self.checkForBrokenLinks(body, '/++apidoc++/Utility/menu.html',
+ basic='mgr:mgrpw')
+ zope.deprecation.__show__.on()
+
+ def testUtilityDetailsView(self):
+ response = self.publish(
+ '/++apidoc++/Utility/'
+ 'zope.app.apidoc.interfaces.IDocumentationModule/'
+ 'Utility/index.html',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(
+ body.find(
+ 'zope.app.apidoc.utilitymodule.utilitymodule.UtilityModule') > 0)
+ self.checkForBrokenLinks(
+ body,
+ '/++apidoc++/Utility/'
+ 'zope.app.apidoc.interfaces.IDocumentationModule/'
+ 'Utility/index.html',
+ basic='mgr:mgrpw')
+
+
def test_suite():
+ UtilityModuleTests.layer = APIDocLayer
return unittest.TestSuite((
doctest.DocFileSuite('README.txt',
setUp=setUp,
@@ -45,6 +88,7 @@
tearDown=placelesssetup.tearDown,
globs={'pprint': doctestunit.pprint},
optionflags=doctest.NORMALIZE_WHITESPACE),
+ unittest.makeSuite(UtilityModuleTests),
))
if __name__ == '__main__':
Deleted: zope.app.apidoc/trunk/src/zope/app/apidoc/zcmlmodule/ftests.py
===================================================================
--- zope.app.apidoc/trunk/src/zope/app/apidoc/zcmlmodule/ftests.py 2007-10-11 02:52:30 UTC (rev 80812)
+++ zope.app.apidoc/trunk/src/zope/app/apidoc/zcmlmodule/ftests.py 2007-10-11 03:13:44 UTC (rev 80813)
@@ -1,53 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2003, 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Functional Tests for ZCML Documentation Module.
-
-$Id$
-"""
-import unittest
-from zope.app.testing.functional import BrowserTestCase
-from zope.app.apidoc.testing import APIDocLayer
-
-class ZCMLModuleTests(BrowserTestCase):
- """Just a couple of tests ensuring that the templates render."""
-
- def testMenu(self):
- response = self.publish(
- '/++apidoc++/ZCML/menu.html',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(body.find('All Namespaces') > 0)
- self.checkForBrokenLinks(body, '/++apidoc++/ZCML/menu.html',
- basic='mgr:mgrpw')
-
- def testDirectiveDetailsView(self):
- response = self.publish('/++apidoc++/ZCML/ALL/configure/index.html',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- body = response.getBody()
- self.assert_(body.find('<i>all namespaces</i>') > 0)
- self.checkForBrokenLinks(body,
- '/++apidoc++/ZCML/ALL/configure/index.html',
- basic='mgr:mgrpw')
-
-
-def test_suite():
- ZCMLModuleTests.layer = APIDocLayer
- return unittest.TestSuite((
- unittest.makeSuite(ZCMLModuleTests),
- ))
-
-if __name__ == '__main__':
- unittest.main(defaultTest='test_suite')
Modified: zope.app.apidoc/trunk/src/zope/app/apidoc/zcmlmodule/tests.py
===================================================================
--- zope.app.apidoc/trunk/src/zope/app/apidoc/zcmlmodule/tests.py 2007-10-11 02:52:30 UTC (rev 80812)
+++ zope.app.apidoc/trunk/src/zope/app/apidoc/zcmlmodule/tests.py 2007-10-11 03:13:44 UTC (rev 80813)
@@ -26,13 +26,16 @@
from zope.app.tree.interfaces import IUniqueId
from zope.app.tree.adapters import LocationUniqueId
from zope.app.testing import placelesssetup, ztapi
+from zope.app.testing.functional import BrowserTestCase
+from zope.app.apidoc.testing import APIDocLayer
from zope.app.apidoc.tests import Root
from zope.app.apidoc.zcmlmodule import Namespace, Directive
from zope.app.apidoc.zcmlmodule import ZCMLModule
from zope.app.apidoc.tests import Root
import zope.app.zcmlfiles
+
def setUp(test):
placelesssetup.setUp()
@@ -40,7 +43,8 @@
ztapi.provideAdapter(None, IPhysicallyLocatable,
LocationPhysicallyLocatable)
- config_file = os.path.join(os.path.dirname(zope.app.zcmlfiles.__file__), 'meta.zcml')
+ config_file = os.path.join(
+ os.path.dirname(zope.app.zcmlfiles.__file__), 'meta.zcml')
# Fix up path for tests.
global old_context
@@ -66,7 +70,32 @@
return Directive(ns, 'page', None, foo, None, ())
+class ZCMLModuleTests(BrowserTestCase):
+ """Just a couple of tests ensuring that the templates render."""
+
+ def testMenu(self):
+ response = self.publish(
+ '/++apidoc++/ZCML/menu.html',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(body.find('All Namespaces') > 0)
+ self.checkForBrokenLinks(body, '/++apidoc++/ZCML/menu.html',
+ basic='mgr:mgrpw')
+
+ def testDirectiveDetailsView(self):
+ response = self.publish('/++apidoc++/ZCML/ALL/configure/index.html',
+ basic='mgr:mgrpw')
+ self.assertEqual(response.getStatus(), 200)
+ body = response.getBody()
+ self.assert_(body.find('<i>all namespaces</i>') > 0)
+ self.checkForBrokenLinks(body,
+ '/++apidoc++/ZCML/ALL/configure/index.html',
+ basic='mgr:mgrpw')
+
+
def test_suite():
+ ZCMLModuleTests.layer = APIDocLayer
return unittest.TestSuite((
doctest.DocFileSuite('README.txt',
setUp=setUp, tearDown=tearDown,
@@ -76,6 +105,7 @@
setUp=setUp, tearDown=tearDown,
globs={'pprint': doctestunit.pprint},
optionflags=doctest.NORMALIZE_WHITESPACE),
+ unittest.makeSuite(ZCMLModuleTests),
))
if __name__ == '__main__':
More information about the Checkins
mailing list