[Checkins] SVN: zope.webdav/trunk/src/zope/webdav/ftests/ Set up the functional layers so that they use the zope.etree way of guessing

Michael Kerrin michael.kerrin at openapp.biz
Wed Apr 4 14:35:41 EDT 2007


Log message for revision 74013:
  Set up the functional layers so that they use the zope.etree way of guessing
  which elemenettree engine so others don't have to edit any ZCML to get the
  tests to pass.
  

Changed:
  U   zope.webdav/trunk/src/zope/webdav/ftests/dav.py
  U   zope.webdav/trunk/src/zope/webdav/ftests/ftesting.zcml
  U   zope.webdav/trunk/src/zope/webdav/ftests/test_z3_locking.py

-=-
Modified: zope.webdav/trunk/src/zope/webdav/ftests/dav.py
===================================================================
--- zope.webdav/trunk/src/zope/webdav/ftests/dav.py	2007-04-04 18:33:35 UTC (rev 74012)
+++ zope.webdav/trunk/src/zope/webdav/ftests/dav.py	2007-04-04 18:35:41 UTC (rev 74013)
@@ -41,11 +41,27 @@
 from zope.webdav.publisher import WebDAVRequest
 from zope.webdav.properties import DAVProperty
 from zope.etree.interfaces import IEtree
+import zope.etree.testing
 from zope.webdav.tests.utils import TestMultiStatusBody
 
+
+class WebDAVLayerClass(zope.app.testing.functional.ZCMLLayer):
+    """
+    """
+
+    def setUp(self):
+        zope.app.testing.functional.ZCMLLayer.setUp(self)
+        zope.etree.testing.etreeSetup()
+
+    def tearDown(self):
+        zope.app.testing.functional.ZCMLLayer.tearDown(self)
+        zope.etree.testing.etreeTearDown()
+
 here = os.path.dirname(os.path.realpath(__file__))
-WebDAVLayer = zope.app.testing.functional.ZCMLLayer(
-    os.path.join(here, "ftesting.zcml"), __name__, "WebDAVLayer")
+WebDAVLayer = WebDAVLayerClass(
+    os.path.join(here, "ftesting.zcml"),
+    __name__, "WebDAVLayer",
+    allow_teardown = True)
 
 
 class IExamplePropertyStorage(interface.Interface):

Modified: zope.webdav/trunk/src/zope/webdav/ftests/ftesting.zcml
===================================================================
--- zope.webdav/trunk/src/zope/webdav/ftests/ftesting.zcml	2007-04-04 18:33:35 UTC (rev 74012)
+++ zope.webdav/trunk/src/zope/webdav/ftests/ftesting.zcml	2007-04-04 18:35:41 UTC (rev 74013)
@@ -46,9 +46,13 @@
   <include package="zope.app.authentication" />
 
   <include package="zope.webdav" />
+
+<!-- This is usually how we register the elementtree engine to use within
+     our application but for testing purposes we use the .dav.WebDAVLayerClass
   <utility
      factory="zope.etree.etree.EtreeEtree"
      />
+-->
 
   <include package="zope.app.folder" />
   <include package="zope.app.file" />

Modified: zope.webdav/trunk/src/zope/webdav/ftests/test_z3_locking.py
===================================================================
--- zope.webdav/trunk/src/zope/webdav/ftests/test_z3_locking.py	2007-04-04 18:33:35 UTC (rev 74012)
+++ zope.webdav/trunk/src/zope/webdav/ftests/test_z3_locking.py	2007-04-04 18:35:41 UTC (rev 74013)
@@ -40,8 +40,8 @@
 from zope.etree.testing import assertXMLEqual
 
 here = os.path.dirname(os.path.realpath(__file__))
-WebDAVLockingLayer = zope.app.testing.functional.ZCMLLayer(
-    os.path.join(here, "ftesting-locking.zcml"), __name__, "WebDAVLockingLayer")
+WebDAVLockingLayer = zope.webdav.ftests.dav.WebDAVLayerClass(
+   os.path.join(here, "ftesting-locking.zcml"), __name__, "WebDAVLockingLayer")
 
 
 class LOCKNotAllowedTestCase(zope.webdav.ftests.dav.DAVTestCase):



More information about the Checkins mailing list