[Zope3-checkins] SVN: Zope3/branches/3.3/ Allow the fucntional nodevmode testing layer to be used from instances

Philipp von Weitershausen philikon at philikon.de
Fri Aug 18 06:48:21 EDT 2006


Log message for revision 69642:
  Allow the fucntional nodevmode testing layer to be used from instances
  as well.  That means the zopeskel files also needed a non-devmode
  ftesting.zcml (called ftesting-base.zcml) and the necessary file path
  manipulation was needed in zope.app.testing.functional.
  

Changed:
  U   Zope3/branches/3.3/src/zope/app/apidoc/browser/ftests.py
  U   Zope3/branches/3.3/src/zope/app/testing/functional.py
  A   Zope3/branches/3.3/zopeskel/etc/ftesting-base.zcml
  D   Zope3/branches/3.3/zopeskel/etc/ftesting.zcml
  A   Zope3/branches/3.3/zopeskel/etc/ftesting.zcml

-=-
Modified: Zope3/branches/3.3/src/zope/app/apidoc/browser/ftests.py
===================================================================
--- Zope3/branches/3.3/src/zope/app/apidoc/browser/ftests.py	2006-08-18 10:37:03 UTC (rev 69641)
+++ Zope3/branches/3.3/src/zope/app/apidoc/browser/ftests.py	2006-08-18 10:48:20 UTC (rev 69642)
@@ -19,7 +19,7 @@
 
 import zope.app.testing.functional
 from zope.testing import doctest
-from zope.app.testing.functional import BrowserTestCase
+from zope.app.testing.functional import BrowserTestCase, FunctionalNoDevMode
 from zope.app.testing.functional import FunctionalDocFileSuite
 
 
@@ -63,13 +63,6 @@
         self.checkForBrokenLinks(body, '/++apidoc++/modulelist.html',
                                  basic='mgr:mgrpw')
 
-
-NoDevModeLayer = zope.app.testing.functional.ZCMLLayer(
-    "ftesting-base.zcml",
-    __name__, 
-    "NoDevModeLayer")
-
-
 def test_suite():
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(APIDocTests))
@@ -80,7 +73,7 @@
         )
 
     nodevmode = FunctionalDocFileSuite("nodevmode.txt")
-    nodevmode.layer = NoDevModeLayer
+    nodevmode.layer = FunctionalNoDevMode
     suite.addTest(nodevmode)
     return suite
 

Modified: Zope3/branches/3.3/src/zope/app/testing/functional.py
===================================================================
--- Zope3/branches/3.3/src/zope/app/testing/functional.py	2006-08-18 10:37:03 UTC (rev 69641)
+++ Zope3/branches/3.3/src/zope/app/testing/functional.py	2006-08-18 10:48:20 UTC (rev 69642)
@@ -214,19 +214,24 @@
 
 if os.path.exists(os.path.join('zopeskel', 'etc', 'ftesting.zcml')):
     Functional = os.path.join('zopeskel', 'etc', 'ftesting.zcml')
+    FunctionalNoDevMode = os.path.join('zopeskel', 'etc', 'ftesting-base.zcml')
 elif os.path.exists(os.path.join('etc', 'ftesting.zcml')):
     Functional = os.path.join('etc', 'ftesting.zcml')
+    FunctionalNoDevMode = os.path.join('etc', 'ftesting-base.zcml')
 else:
     # let's hope that the file is in our CWD. If not, we'll get an
     # error anyways, but we can't just throw an error if we don't find
     # that file. This module might be imported for other things as
     # well, not only starting up Zope from ftesting.zcml.    
     Functional = 'ftesting.zcml'
+    FunctionalNoDevMode = 'ftesting-base.zcml'
 
 Functional = os.path.abspath(Functional)
+FunctionalNoDevMode = os.path.abspath(FunctionalNoDevMode)
 
-Functional = ZCMLLayer(
-    Functional, __name__, 'Functional')
+Functional = ZCMLLayer(Functional, __name__, 'Functional')
+FunctionalNoDevMode = ZCMLLayer(FunctionalNoDevMode, __name__,
+                                'FunctionalNoDevMode')
 
 class FunctionalTestCase(unittest.TestCase):
     """Functional test case."""

Copied: Zope3/branches/3.3/zopeskel/etc/ftesting-base.zcml (from rev 69633, Zope3/branches/3.3/zopeskel/etc/ftesting.zcml)
===================================================================
--- Zope3/branches/3.3/zopeskel/etc/ftesting.zcml	2006-08-18 09:22:02 UTC (rev 69633)
+++ Zope3/branches/3.3/zopeskel/etc/ftesting-base.zcml	2006-08-18 10:48:20 UTC (rev 69642)
@@ -0,0 +1,59 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   xmlns:meta="http://namespaces.zope.org/meta"
+   i18n_domain="zope"
+   >
+
+  <!-- This file is the equivalent of site.zcml and it is -->
+  <!-- used for functional testing setup -->
+
+  <include package="zope.app" />
+  <include package="zope.app" file="ftesting.zcml" />
+
+  <include files="package-includes/*-meta.zcml" />
+  <include files="package-includes/*-configure.zcml" />
+  <include files="package-includes/*-ftesting.zcml" />
+
+  <include file="securitypolicy.zcml" />
+  <include file="securitypolicy-ftesting.zcml" />
+
+  <!-- Principals -->
+
+  <unauthenticatedPrincipal
+      id="zope.anybody"
+      title="Unauthenticated User" />
+
+  <unauthenticatedGroup
+    id="zope.Anybody"
+    title="Unauthenticated Users"
+    />
+
+  <authenticatedGroup
+    id="zope.Authenticated"
+    title="Authenticated Users"
+    />
+
+  <everybodyGroup
+    id="zope.Everybody"
+    title="All Users"
+    />
+
+  <!-- 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" />
+
+  <includeOverrides file="overrides_ftesting.zcml" />
+
+</configure>

Deleted: Zope3/branches/3.3/zopeskel/etc/ftesting.zcml
===================================================================
--- Zope3/branches/3.3/zopeskel/etc/ftesting.zcml	2006-08-18 10:37:03 UTC (rev 69641)
+++ Zope3/branches/3.3/zopeskel/etc/ftesting.zcml	2006-08-18 10:48:20 UTC (rev 69642)
@@ -1,62 +0,0 @@
-<configure
-   xmlns="http://namespaces.zope.org/zope"
-   xmlns:meta="http://namespaces.zope.org/meta"
-   i18n_domain="zope"
-   >
-
-  <!-- Turn on the devmode -->
-  <meta:provides feature="devmode" />
-
-  <!-- This file is the equivalent of site.zcml and it is -->
-  <!-- used for functional testing setup -->
-
-  <include package="zope.app" />
-  <include package="zope.app" file="ftesting.zcml" />
-
-  <include files="package-includes/*-meta.zcml" />
-  <include files="package-includes/*-configure.zcml" />
-  <include files="package-includes/*-ftesting.zcml" />
-
-  <include file="securitypolicy.zcml" />
-  <include file="securitypolicy-ftesting.zcml" />
-
-  <!-- Principals -->
-
-  <unauthenticatedPrincipal
-      id="zope.anybody"
-      title="Unauthenticated User" />
-
-  <unauthenticatedGroup
-    id="zope.Anybody"
-    title="Unauthenticated Users"
-    />
-
-  <authenticatedGroup
-    id="zope.Authenticated"
-    title="Authenticated Users"
-    />
-
-  <everybodyGroup
-    id="zope.Everybody"
-    title="All Users"
-    />
-
-  <!-- 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" />
-
-  <includeOverrides file="overrides_ftesting.zcml" />
-
-</configure>

Added: Zope3/branches/3.3/zopeskel/etc/ftesting.zcml
===================================================================
--- Zope3/branches/3.3/zopeskel/etc/ftesting.zcml	2006-08-18 10:37:03 UTC (rev 69641)
+++ Zope3/branches/3.3/zopeskel/etc/ftesting.zcml	2006-08-18 10:48:20 UTC (rev 69642)
@@ -0,0 +1,12 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   xmlns:meta="http://namespaces.zope.org/meta"
+   i18n_domain="zope"
+   >
+
+  <!-- Turn on the devmode -->
+  <meta:provides feature="devmode" />
+
+  <include file="ftesting-base.zcml" />
+
+</configure>


Property changes on: Zope3/branches/3.3/zopeskel/etc/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Zope3-Checkins mailing list