[Zope3-checkins] CVS: Zope3/src/zope/app/apidoc/servicemodule - ftests.py:1.1 tests.py:1.2

Stephan Richter srichter at cosmos.phy.tufts.edu
Sun Mar 28 18:41:13 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/apidoc/servicemodule
In directory cvs.zope.org:/tmp/cvs-serv23020/src/zope/app/apidoc/servicemodule

Modified Files:
	tests.py 
Added Files:
	ftests.py 
Log Message:


Added tests.




=== Added File Zope3/src/zope/app/apidoc/servicemodule/ftests.py ===
##############################################################################
#
# 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.0 (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 Service Documentation Module.

$Id: ftests.py,v 1.1 2004/03/28 23:41:12 srichter Exp $
"""
import unittest
from zope.testing.functional import BrowserTestCase

class ServiceModuleTests(BrowserTestCase):
    """Just a couple of tests ensuring that the templates render."""

    def testMenu(self):
        response = self.publish(
            '/++apidoc++/Service/menu.html', 
            basic='mgr:mgrpw')
        self.assertEqual(response.getStatus(), 200)
        body = response.getBody()
        self.assert_(body.find('Services') > 0)
        self.checkForBrokenLinks(body, '/++apidoc++/Service/menu.html',
                                 basic='mgr:mgrpw')

    def testServiceDetailsView(self):
        response = self.publish(
            '/++apidoc++/Service/Services/index.html',
            basic='mgr:mgrpw')
        self.assertEqual(response.getStatus(), 200)
        body = response.getBody()
        self.assert_(body.find('Services Service') > 0)
        self.checkForBrokenLinks(body,
                                 '/++apidoc++/Service/Services/index.html',
                                 basic='mgr:mgrpw')


def test_suite():
    return unittest.TestSuite((
        unittest.makeSuite(ServiceModuleTests),
        ))

if __name__ == '__main__':
    unittest.main(defaultTest='test_suite')


=== Zope3/src/zope/app/apidoc/servicemodule/tests.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/apidoc/servicemodule/tests.py:1.1	Thu Feb 19 15:46:41 2004
+++ Zope3/src/zope/app/apidoc/servicemodule/tests.py	Sun Mar 28 18:41:12 2004
@@ -17,10 +17,29 @@
 """
 import unittest
 from zope.testing.doctestunit import DocTestSuite
-    
+from zope.app.tests import placelesssetup, ztapi
+
+from zope.app.tree.interfaces import IUniqueId
+from zope.app.tree.adapters import LocationUniqueId 
+
+from zope.app.traversing.interfaces import IPhysicallyLocatable
+from zope.app.location import LocationPhysicallyLocatable
+
+def setUp():
+    placelesssetup.setUp()
+    ztapi.provideAdapter(None, IUniqueId, LocationUniqueId)
+    ztapi.provideAdapter(None, IPhysicallyLocatable,
+                         LocationPhysicallyLocatable)
+
+def tearDown():
+    placelesssetup.tearDown()
+
+
 def test_suite():
     return unittest.TestSuite((
         DocTestSuite('zope.app.apidoc.servicemodule'),
+        DocTestSuite('zope.app.apidoc.servicemodule.browser',
+                     setUp=setUp, tearDown=tearDown),
         ))
 
 if __name__ == '__main__':




More information about the Zope3-Checkins mailing list