[Zope3-checkins] CVS: Zope3/src/zope/app/dav/ftests - test_propfind.py:1.3

Sidnei da Silva sidnei@x3ng.com.br
Mon, 23 Jun 2003 13:17:33 -0400


Update of /cvs-repository/Zope3/src/zope/app/dav/ftests
In directory cvs.zope.org:/tmp/cvs-serv14183/src/zope/app/dav/ftests

Modified Files:
	test_propfind.py 
Log Message:
1. Whitespace cleanup. 2. Docstring fixing. 3. Modified DAV code and tests to append '/' to the path if the last element is 'dir-like'. 4. Support for MKCOL with tests + functional tests. 5. Refactored DAV functional tests into a base class for reusing

=== Zope3/src/zope/app/dav/ftests/test_propfind.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/dav/ftests/test_propfind.py:1.2	Thu May 22 11:10:58 2003
+++ Zope3/src/zope/app/dav/ftests/test_propfind.py	Mon Jun 23 13:17:02 2003
@@ -11,25 +11,23 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""Functional tests for virtual hosting.
+"""Functional tests for PROPFIND.
 
 $Id$
 """
 
 import unittest
 from datetime import datetime
-from zope.testing.functional import HTTPTestCase
-from zope.app.content.zpt import ZPTPage
-from zope.app.content.folder import Folder
-from transaction import get_transaction
-from zope.pagetemplate.tests.util import normalize_xml
+from zope.app.dav.ftests.dav import DAVTestCase
 from zope.component import getAdapter
 from zope.app.interfaces.dublincore import IZopeDublinCore
 from zope.app.traversing import traverse
+from transaction import get_transaction
+from zope.pagetemplate.tests.util import normalize_xml
 
 __metaclass__ = type
 
-class TestPROPFIND(HTTPTestCase):
+class TestPROPFIND(DAVTestCase):
 
     def test_dctitle(self):
         self.addPage('/pt', u'<span />')
@@ -91,32 +89,6 @@
         </response>
         </multistatus>""" % {'ns':ns, 'prop':prop, 'expect':expect})
         self.assertEquals(s1, s2)
-
-    def createFolders(self, path):
-        """addFolders('/a/b/c/d') would traverse and/or create three nested
-        folders (a, b, c) and return a tuple (c, 'd') where c is a Folder
-        instance at /a/b/c."""
-        folder = self.getRootFolder()
-        if path[0] == '/':
-            path = path[1:]
-        path = path.split('/')
-        for id in path[:-1]:
-            try:
-                folder = folder[id]
-            except KeyError:
-                folder.setObject(id, Folder())
-                folder = folder[id]
-        return folder, path[-1]
-
-    def createObject(self, path, obj):
-        folder, id = self.createFolders(path)
-        folder.setObject(id, obj)
-        get_transaction().commit()
-
-    def addPage(self, path, content):
-        page = ZPTPage()
-        page.source = content
-        self.createObject(path, page)
 
 def test_suite():
     suite = unittest.TestSuite()