[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ Collector #2136: Map ResourceLockedError to the correct response code.

Tres Seaver cvs-admin at zope.org
Wed Jun 21 12:47:16 EDT 2006


Log message for revision 68778:
  Collector #2136: Map ResourceLockedError to the correct response code.

Changed:
  U   Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
  U   Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/HTTPResponse.py
  U   Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/tests/testHTTPResponse.py

-=-
Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
===================================================================
--- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt	2006-06-21 16:10:05 UTC (rev 68777)
+++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt	2006-06-21 16:47:12 UTC (rev 68778)
@@ -18,6 +18,8 @@
 
     Bugs fixed
 
+      - Collector #2136: Map ResourceLockedError to the correct response code.
+
       - Collector #2016: DemoStorage couldn't wrap base storages without
                          an '_oid' attribute.
 

Modified: Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/HTTPResponse.py
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/HTTPResponse.py	2006-06-21 16:10:05 UTC (rev 68777)
+++ Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/HTTPResponse.py	2006-06-21 16:47:12 UTC (rev 68778)
@@ -97,6 +97,7 @@
 status_codes['nameerror'] = 503
 status_codes['keyerror'] = 503
 status_codes['redirect'] = 300
+status_codes['resourcelockederror'] = 423
 
 
 start_of_header_search = re.compile('(<head[^>]*>)', re.IGNORECASE).search

Modified: Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/tests/testHTTPResponse.py
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/tests/testHTTPResponse.py	2006-06-21 16:10:05 UTC (rev 68777)
+++ Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/tests/testHTTPResponse.py	2006-06-21 16:47:12 UTC (rev 68778)
@@ -74,7 +74,13 @@
         response.appendHeader('XXX', 'foo')
         self.assertEqual(response.headers.get('xxx'), 'bar,\n\tfoo')
 
+    def test_setStatus_ResourceLockedError(self):
+        response = self._makeOne()
+        from webdav.Lockable import ResourceLockedError
+        response.setStatus(ResourceLockedError)
+        self.assertEqual(response.status, 423)
 
+
 def test_suite():
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(HTTPResponseTests, 'test'))



More information about the Zope-Checkins mailing list