[Checkins] SVN: Zope/trunk/lib/python/webdav/ The stringio return value is used during recursion, the deleted test asserted

Chris McDonough chrism at plope.com
Sat Jun 16 21:06:41 EDT 2007


Log message for revision 76724:
  The stringio return value is used during recursion, the deleted test asserted
  the wrong thing.
  

Changed:
  U   Zope/trunk/lib/python/webdav/davcmds.py
  U   Zope/trunk/lib/python/webdav/tests/test_davcmds.py

-=-
Modified: Zope/trunk/lib/python/webdav/davcmds.py
===================================================================
--- Zope/trunk/lib/python/webdav/davcmds.py	2007-06-17 01:02:36 UTC (rev 76723)
+++ Zope/trunk/lib/python/webdav/davcmds.py	2007-06-17 01:06:40 UTC (rev 76724)
@@ -479,7 +479,7 @@
                     uri = urljoin(url, absattr(ob.getId()))
                     self.apply(ob, token, uri, result, top=0)
         if not top:
-            return result.getvalue()
+            return result
         if result.getvalue():
             # One or more subitems probably failed, so close the multistatus
             # element and clear out all succesful unlocks

Modified: Zope/trunk/lib/python/webdav/tests/test_davcmds.py
===================================================================
--- Zope/trunk/lib/python/webdav/tests/test_davcmds.py	2007-06-17 01:02:36 UTC (rev 76723)
+++ Zope/trunk/lib/python/webdav/tests/test_davcmds.py	2007-06-17 01:06:40 UTC (rev 76724)
@@ -21,19 +21,6 @@
                 return self.token == token
         return Lockable(locktoken)
 
-    def test_apply_nontop_resource_returns_string(self):
-        """ When top=0 in unlock constructor, prior to Zope 2.11, the
-        unlock.apply method would return a StringIO.  This was bogus
-        because a StringIO cannot be used as a response body via the
-        standard RESPONSE.setBody() command.  Only strings or objects
-        with an asHTML method may be passed into setBody()."""
-
-        inst = self._makeOne()
-        lockable = self._makeLockable(None)
-        result = inst.apply(lockable, 'bogus',
-                            url='http://example.com/foo/UNLOCK', top=0)
-        self.failUnless(isinstance(result, str))
-
     def test_apply_bogus_lock(self):
         """
         When attempting to unlock a resource with a token that the
@@ -52,6 +39,7 @@
         lockable = self._makeLockable(None)
         result = inst.apply(lockable, 'bogus',
                             url='http://example.com/foo/UNLOCK', top=0)
+        result = result.getvalue()
         self.assertNotEqual(
             result.find('<d:status>HTTP/1.1 400 Bad Request</d:status>'),
             -1)



More information about the Checkins mailing list