[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/apidoc/ - Added APIDocLayer and APIDocNoDevModeLayer

Baiju M baiju.m.mail at gmail.com
Fri Feb 9 05:58:50 EST 2007


Log message for revision 72481:
   - Added APIDocLayer and APIDocNoDevModeLayer
   - Replaced FunctionalNoDevMode layer with APIDocNoDevModeLayer
  

Changed:
  U   Zope3/trunk/src/zope/app/apidoc/browser/ftests.py
  U   Zope3/trunk/src/zope/app/apidoc/codemodule/browser/ftests.py
  A   Zope3/trunk/src/zope/app/apidoc/ftesting-base.zcml
  A   Zope3/trunk/src/zope/app/apidoc/ftesting.zcml
  U   Zope3/trunk/src/zope/app/apidoc/ifacemodule/ftests.py
  A   Zope3/trunk/src/zope/app/apidoc/testing.py
  U   Zope3/trunk/src/zope/app/apidoc/utilitymodule/ftests.py
  U   Zope3/trunk/src/zope/app/apidoc/zcmlmodule/ftests.py

-=-
Modified: Zope3/trunk/src/zope/app/apidoc/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/ftests.py	2007-02-09 09:14:25 UTC (rev 72480)
+++ Zope3/trunk/src/zope/app/apidoc/browser/ftests.py	2007-02-09 10:58:48 UTC (rev 72481)
@@ -21,8 +21,8 @@
 from zope.testing import doctest
 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."""
 
@@ -65,15 +65,18 @@
 
 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)
+    apidoc_doctest.layer = APIDocLayer
     suite.addTest(
-        FunctionalDocFileSuite(
-            "README.txt",
-            optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE),
+        apidoc_doctest,
         )
 
     nodevmode = FunctionalDocFileSuite("nodevmode.txt")
-    nodevmode.layer = FunctionalNoDevMode
+    nodevmode.layer = APIDocNoDevModeLayer
     suite.addTest(nodevmode)
     return suite
 

Modified: Zope3/trunk/src/zope/app/apidoc/codemodule/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/codemodule/browser/ftests.py	2007-02-09 09:14:25 UTC (rev 72480)
+++ Zope3/trunk/src/zope/app/apidoc/codemodule/browser/ftests.py	2007-02-09 10:58:48 UTC (rev 72481)
@@ -20,6 +20,7 @@
 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."""
@@ -97,11 +98,14 @@
 
 
 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),
-        FunctionalDocFileSuite(
-            "introspector.txt",
-            optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE),
+        introspector,
         ))
 
 if __name__ == '__main__':

Added: Zope3/trunk/src/zope/app/apidoc/ftesting-base.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/ftesting-base.zcml	2007-02-09 09:14:25 UTC (rev 72480)
+++ Zope3/trunk/src/zope/app/apidoc/ftesting-base.zcml	2007-02-09 10:58:48 UTC (rev 72481)
@@ -0,0 +1,55 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   i18n_domain="zope"
+   package="zope.app.apidoc"
+   >
+
+  <!-- This file is the equivalent of site.zcml and it is -->
+  <!-- used for functional testing setup -->
+
+  <include package="zope.app.apidoc" file="meta.zcml" />
+  <include package="zope.app.preference" file="meta.zcml" />
+  <include package="zope.app.securitypolicy" file="meta.zcml" />
+
+  <include package="zope.app.zcmlfiles" />
+  <include package="zope.app.apidoc"/>
+  <include package="zope.app.file"/>
+  <include package="zope.app.preference" />
+  <include package="zope.app.renderer"/>
+  <include package="zope.app.tree"/>
+  <include package="zope.app.authentication" />
+  <include package="zope.app.securitypolicy" />
+
+  <securityPolicy
+    component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+  <role id="zope.Anonymous" title="Everybody"
+                 description="All users have this role implicitly" />
+  <role id="zope.Manager" title="Site Manager" />
+
+  <!-- Replace the following directive if you don't want public access -->
+  <grant permission="zope.View"
+                  role="zope.Anonymous" />
+
+  <grantAll role="zope.Manager" />
+
+  <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
+
+  <!-- Principal that tests generally run as -->
+  <principal
+      id="zope.mgr"
+      title="Manager"
+      login="mgr"
+      password="mgrpw" />
+
+  <!-- Bootstrap principal used to make local grant to the principal above -->
+  <principal
+      id="zope.globalmgr"
+      title="Manager"
+      login="globalmgr"
+      password="globalmgrpw" />
+
+  <grant role="zope.Manager" principal="zope.globalmgr" />
+
+
+</configure>


Property changes on: Zope3/trunk/src/zope/app/apidoc/ftesting-base.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Zope3/trunk/src/zope/app/apidoc/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/ftesting.zcml	2007-02-09 09:14:25 UTC (rev 72480)
+++ Zope3/trunk/src/zope/app/apidoc/ftesting.zcml	2007-02-09 10:58:48 UTC (rev 72481)
@@ -0,0 +1,13 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   xmlns:meta="http://namespaces.zope.org/meta"
+   i18n_domain="zope"
+   package="zope.app.apidoc"
+   >
+
+  <!-- Turn on the devmode -->
+  <meta:provides feature="devmode" />
+
+  <include file="ftesting-base.zcml" />
+
+</configure>


Property changes on: Zope3/trunk/src/zope/app/apidoc/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: Zope3/trunk/src/zope/app/apidoc/ifacemodule/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/ifacemodule/ftests.py	2007-02-09 09:14:25 UTC (rev 72480)
+++ Zope3/trunk/src/zope/app/apidoc/ifacemodule/ftests.py	2007-02-09 10:58:48 UTC (rev 72481)
@@ -17,6 +17,7 @@
 """
 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."""
@@ -52,6 +53,7 @@
 
 
 def test_suite():
+    InterfaceModuleTests.layer = APIDocLayer
     return unittest.TestSuite((
         unittest.makeSuite(InterfaceModuleTests),
         ))

Added: Zope3/trunk/src/zope/app/apidoc/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/testing.py	2007-02-09 09:14:25 UTC (rev 72480)
+++ Zope3/trunk/src/zope/app/apidoc/testing.py	2007-02-09 10:58:48 UTC (rev 72481)
@@ -0,0 +1,30 @@
+##############################################################################
+#
+# Copyright (c) 2007 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.
+#
+##############################################################################
+"""zope.app.apidoc common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+APIDocNoDevModeLayer = ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting-base.zcml'),
+    __name__, 'APIDocNoDevModeLayer', allow_teardown=True)
+
+APIDocLayer = ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'APIDocLayer', allow_teardown=True)


Property changes on: Zope3/trunk/src/zope/app/apidoc/testing.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: Zope3/trunk/src/zope/app/apidoc/utilitymodule/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/utilitymodule/ftests.py	2007-02-09 09:14:25 UTC (rev 72480)
+++ Zope3/trunk/src/zope/app/apidoc/utilitymodule/ftests.py	2007-02-09 10:58:48 UTC (rev 72481)
@@ -18,6 +18,7 @@
 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."""
@@ -59,6 +60,7 @@
 
 
 def test_suite():
+    UtilityModuleTests.layer = APIDocLayer
     return unittest.TestSuite((
         unittest.makeSuite(UtilityModuleTests),
         ))

Modified: Zope3/trunk/src/zope/app/apidoc/zcmlmodule/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/zcmlmodule/ftests.py	2007-02-09 09:14:25 UTC (rev 72480)
+++ Zope3/trunk/src/zope/app/apidoc/zcmlmodule/ftests.py	2007-02-09 10:58:48 UTC (rev 72481)
@@ -17,6 +17,7 @@
 """
 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."""
@@ -43,6 +44,7 @@
 
 
 def test_suite():
+    ZCMLModuleTests.layer = APIDocLayer
     return unittest.TestSuite((
         unittest.makeSuite(ZCMLModuleTests),
         ))



More information about the Zope3-Checkins mailing list