[z3-checkins] r9548 - in z3/davuseragent/trunk: . ftests ftests/cadaver

philikon at codespeak.net philikon at codespeak.net
Tue Mar 1 16:45:56 MET 2005


Author: philikon
Date: Tue Mar  1 16:45:56 2005
New Revision: 9548

Added:
   z3/davuseragent/trunk/ftests/
   z3/davuseragent/trunk/ftests/__init__.py
      - copied unchanged from r9408, z3/davuseragent/trunk/__init__.py
   z3/davuseragent/trunk/ftests/cadaver/
   z3/davuseragent/trunk/ftests/cadaver.txt
   z3/davuseragent/trunk/ftests/cadaver/watch0001.request
   z3/davuseragent/trunk/ftests/cadaver/watch0001.response
   z3/davuseragent/trunk/ftests/dut.py   (contents, props changed)
   z3/davuseragent/trunk/ftests/functional.py   (contents, props changed)
   z3/davuseragent/trunk/ftests/test_cadaver.py   (contents, props changed)
Modified:
   z3/davuseragent/trunk/requestfactory.py
Log:
a sketch at functional tests


Added: z3/davuseragent/trunk/ftests/cadaver.txt
==============================================================================
--- (empty file)
+++ z3/davuseragent/trunk/ftests/cadaver.txt	Tue Mar  1 16:45:56 2005
@@ -0,0 +1,187 @@
+=======
+Cadaver
+=======
+
+Cadaver first wants to see who and what is around:
+
+  >>> print dav(r"""
+  ... OPTIONS / HTTP/1.1
+  ... User-Agent: neon/0.23.9 cadaver/0.20.5
+  ... Te: trailers
+  ... """)
+  HTTP/1.1 200 Ok
+  Allow: GET, HEAD, POST, PUT, DELETE, OPTIONS, PROPFIND, MKCOL, LOCK, UNLOCK
+  Content-Length: 0
+  Dav: 1,2
+  Ms-Author-Via: DAV
+  <BLANKLINE>
+
+
+  >>> print dav(r"""
+  ... PROPFIND / HTTP/1.1
+  ... User-Agent: neon/0.23.9 cadaver/0.20.5
+  ... Content-Length: 269
+  ... Content-Type: application/xml
+  ... Depth: 0
+  ... Te: trailers
+  ... 
+  ... <?xml version="1.0" encoding="utf-8"?>
+  ... <propfind xmlns="DAV:"><prop>
+  ... <getcontentlength xmlns="DAV:"/>
+  ... <getlastmodified xmlns="DAV:"/>
+  ... <displayname xmlns="DAV:"/>
+  ... <executable xmlns="http://apache.org/dav/props/"/>
+  ... <resourcetype xmlns="DAV:"/>
+  ... </prop></propfind>
+  ... """)
+  HTTP/1.1 207 Multi-Status
+  Content-Length: 471
+  <BLANKLINE>
+  <?xml version="1.0" ?>
+  <multistatus xmlns="DAV:"><response><href>http://localhost:9080/</href><propstat><prop><getcontentlength>5 items</getcontentlength><getlastmodified></getlastmodified><displayname>/</displayname><resourcetype><collection/></resourcetype></prop><status>HTTP/1.1 200 OK</status></propstat><propstat><prop xmlns:a0="http://apache.org/dav/props/"><executable xmlns="a0"/></prop><status>HTTP/1.1 404 Not Found</status></propstat></response></multistatus>
+
+
+Now let's upload a file:
+
+  >>> print dav(r"""
+  ... PUT /test HTTP/1.1
+  ... User-Agent: neon/0.23.9 cadaver/0.20.5
+  ... Content-Length: 20
+  ... Te: trailers
+  ... 
+  ... This is a test file
+  ... """)
+  HTTP/1.1 401 Unauthorized
+  Content-Length: 0
+  Www-Authenticate: basic realm='Zope'
+  <BLANKLINE>
+
+
+  >>> print dav(r"""
+  ... PUT /test HTTP/1.1
+  ... User-Agent: neon/0.23.9 cadaver/0.20.5
+  ... Authorization: Basic mgr:mgrpw
+  ... Content-Length: 20
+  ... Te: trailers
+  ... 
+  ... This is a test file
+  ... """)
+  HTTP/1.1 201 Created
+  Content-Length: 0
+  <BLANKLINE>
+
+
+  >>> print dav(r"""
+  ... PROPFIND /test HTTP/1.1
+  ... User-Agent: neon/0.23.9 cadaver/0.20.5
+  ... Authorization: Basic mgr:mgrpw
+  ... Content-Length: 269
+  ... Content-Type: application/xml
+  ... Depth: 0
+  ... Te: trailers
+  ... 
+  ... <?xml version="1.0" encoding="utf-8"?>
+  ... <propfind xmlns="DAV:"><prop>
+  ... <getcontentlength xmlns="DAV:"/>
+  ... <getlastmodified xmlns="DAV:"/>
+  ... <displayname xmlns="DAV:"/>
+  ... <executable xmlns="http://apache.org/dav/props/"/>
+  ... <resourcetype xmlns="DAV:"/>
+  ... </prop></propfind>
+  ... """)
+  HTTP/1.1 207 Multi-Status
+  Content-Length: 491
+  <BLANKLINE>
+  <?xml version="1.0" ?>
+  <multistatus xmlns="DAV:"><response><href>http://localhost:9080/test</href><propstat><prop><getcontentlength>1 KB</getcontentlength><getlastmodified>Tue, 01 Mar 2005 15:30:08 GMT</getlastmodified><displayname>test</displayname><resourcetype></resourcetype></prop><status>HTTP/1.1 200 OK</status></propstat><propstat><prop xmlns:a0="http://apache.org/dav/props/"><executable xmlns="a0"/></prop><status>HTTP/1.1 404 Not Found</status></propstat></response></multistatus>
+
+
+Let's edit the file again
+
+  >>> print dav(r"""
+  ... OPTIONS /test HTTP/1.1
+  ... User-Agent: neon/0.23.9 cadaver/0.20.5
+  ... Authorization: Basic mgr:mgrpw
+  ... Te: trailers
+  ... """)
+  HTTP/1.1 200 Ok
+  Allow: GET, HEAD, POST, PUT, DELETE, OPTIONS, PROPFIND, MKCOL, LOCK, UNLOCK
+  Content-Length: 0
+  Dav: 1,2
+  Ms-Author-Via: DAV
+  <BLANKLINE>
+
+
+  >>> print dav(r"""
+  ... LOCK /test HTTP/1.1
+  ... User-Agent: neon/0.23.9 cadaver/0.20.5
+  ... Authorization: Basic mgr:mgrpw
+  ... Content-Length: 145
+  ... Content-Type: application/xml
+  ... Depth: 0
+  ... Te: trailers
+  ... 
+  ... <?xml version="1.0" encoding="utf-8"?>
+  ... <lockinfo xmlns='DAV:'>
+  ...  <lockscope><exclusive/></lockscope>
+  ... <locktype><write/></locktype></lockinfo>
+  ... """)
+  HTTP/1.1 200 Ok
+  Content-Length: 351
+  Lock-Token: opaquelocktoken:1109691011.03
+  <BLANKLINE>
+  <?xml version="1.0" encoding="utf-8" ?>
+  <prop xmlns="DAV:">
+  <lockdiscovery>
+    <activelock>
+      <locktype><write/></locktype>
+      <lockscope><exclusive/></lockscope>
+      <depth>0</depth>
+      <owner></owner>
+      <timeout>Second-3600</timeout>
+      <locktoken><href>opaquelocktoken:1109691011.03</href></locktoken>
+    </activelock>
+  </lockdiscovery>
+  </prop>
+
+
+  >>> print dav(r"""
+  ... GET /test HTTP/1.1
+  ... User-Agent: neon/0.23.9 cadaver/0.20.5
+  ... Authorization: Basic mgr:mgrpw
+  ... Te: trailers
+  ... """)
+  HTTP/1.1 200 Ok
+  Content-Length: 20
+  <BLANKLINE>
+  This is a test file
+  <BLANKLINE>
+
+
+  >>> print dav(r"""
+  ... PUT /test HTTP/1.1
+  ... User-Agent: neon/0.23.9 cadaver/0.20.5
+  ... Authorization: Basic mgr:mgrpw
+  ... Content-Length: 28
+  ... If: <http://localhost:9080/test> (<opaquelocktoken:1109691011.03>)
+  ... Te: trailers
+  ... 
+  ... This is an edited test file
+  ... """)
+  HTTP/1.1 200 Ok
+  Content-Length: 0
+  <BLANKLINE>
+
+
+  >>> print dav(r"""
+  ... UNLOCK /test HTTP/1.1
+  ... User-Agent: neon/0.23.9 cadaver/0.20.5
+  ... Authorization: Basic mgr:mgrpw
+  ... Lock-Token: <opaquelocktoken:1109691011.03>
+  ... Te: trailers
+  ... """)
+  HTTP/1.1 204 No Content
+  Content-Length: 0
+  <BLANKLINE>
+
+Well, that worked well...

Added: z3/davuseragent/trunk/ftests/cadaver/watch0001.request
==============================================================================
--- (empty file)
+++ z3/davuseragent/trunk/ftests/cadaver/watch0001.request	Tue Mar  1 16:45:56 2005
@@ -0,0 +1,105 @@
+OPTIONS / HTTP/1.1
+Host: localhost:9080
+User-Agent: neon/0.23.9 cadaver/0.20.5
+Keep-Alive: 
+Connection: TE, Keep-Alive
+TE: trailers
+
+PROPFIND / HTTP/1.1
+Host: localhost:9080
+User-Agent: neon/0.23.9 cadaver/0.20.5
+Connection: TE
+TE: trailers
+Depth: 0
+Content-Length: 269
+Content-Type: application/xml
+
+<?xml version="1.0" encoding="utf-8"?>
+<propfind xmlns="DAV:"><prop>
+<getcontentlength xmlns="DAV:"/>
+<getlastmodified xmlns="DAV:"/>
+<displayname xmlns="DAV:"/>
+<executable xmlns="http://apache.org/dav/props/"/>
+<resourcetype xmlns="DAV:"/>
+</prop></propfind>
+PUT /test HTTP/1.1
+Host: localhost:9080
+User-Agent: neon/0.23.9 cadaver/0.20.5
+Connection: TE
+TE: trailers
+Content-Length: 20
+
+This is a test file
+PUT /test HTTP/1.1
+Host: localhost:9080
+User-Agent: neon/0.23.9 cadaver/0.20.5
+Connection: TE
+TE: trailers
+Content-Length: 20
+Authorization: Basic bWdyOm1ncnB3
+
+This is a test file
+PROPFIND /test HTTP/1.1
+Host: localhost:9080
+User-Agent: neon/0.23.9 cadaver/0.20.5
+Connection: TE
+TE: trailers
+Depth: 0
+Content-Length: 269
+Content-Type: application/xml
+Authorization: Basic bWdyOm1ncnB3
+
+<?xml version="1.0" encoding="utf-8"?>
+<propfind xmlns="DAV:"><prop>
+<getcontentlength xmlns="DAV:"/>
+<getlastmodified xmlns="DAV:"/>
+<displayname xmlns="DAV:"/>
+<executable xmlns="http://apache.org/dav/props/"/>
+<resourcetype xmlns="DAV:"/>
+</prop></propfind>
+OPTIONS /test HTTP/1.1
+Host: localhost:9080
+User-Agent: neon/0.23.9 cadaver/0.20.5
+Connection: TE
+TE: trailers
+Authorization: Basic bWdyOm1ncnB3
+
+LOCK /test HTTP/1.1
+Host: localhost:9080
+User-Agent: neon/0.23.9 cadaver/0.20.5
+Connection: TE
+TE: trailers
+Content-Length: 145
+Content-Type: application/xml
+Depth: 0
+Authorization: Basic bWdyOm1ncnB3
+
+<?xml version="1.0" encoding="utf-8"?>
+<lockinfo xmlns='DAV:'>
+ <lockscope><exclusive/></lockscope>
+<locktype><write/></locktype></lockinfo>
+GET /test HTTP/1.1
+Host: localhost:9080
+User-Agent: neon/0.23.9 cadaver/0.20.5
+Connection: TE
+TE: trailers
+Authorization: Basic bWdyOm1ncnB3
+
+PUT /test HTTP/1.1
+Host: localhost:9080
+User-Agent: neon/0.23.9 cadaver/0.20.5
+Connection: TE
+TE: trailers
+Content-Length: 28
+If: <http://localhost:9080/test> (<opaquelocktoken:1109691011.03>)
+Authorization: Basic bWdyOm1ncnB3
+
+This is an edited test file
+UNLOCK /test HTTP/1.1
+Host: localhost:9080
+User-Agent: neon/0.23.9 cadaver/0.20.5
+Connection: TE
+TE: trailers
+Lock-Token: <opaquelocktoken:1109691011.03>
+Authorization: Basic bWdyOm1ncnB3
+

Added: z3/davuseragent/trunk/ftests/cadaver/watch0001.response
==============================================================================
--- (empty file)
+++ z3/davuseragent/trunk/ftests/cadaver/watch0001.response	Tue Mar  1 16:45:56 2005
@@ -0,0 +1,83 @@
+HTTP/1.1 200 Ok
+Content-Length: 0
+Allow: GET, HEAD, POST, PUT, DELETE, OPTIONS, PROPFIND, MKCOL, LOCK, UNLOCK
+X-Powered-By: Zope (www.zope.org), Python (www.python.org)
+Date: Tue, 01 Mar 2005 15:29:46 GMT
+DAV: 1,2
+MS-Author-Via: DAV
+Server: zope.server.http (DAVUserAgent)
+
+HTTP/1.1 207 Multi-Status
+Date: Tue, 01 Mar 2005 15:29:47 GMT
+Content-Length: 471
+X-Powered-By: Zope (www.zope.org), Python (www.python.org)
+Server: zope.server.http (DAVUserAgent)
+
+<?xml version="1.0" ?>
+<multistatus xmlns="DAV:"><response><href>http://localhost:9080/</href><propstat><prop><getcontentlength>5 items</getcontentlength><getlastmodified></getlastmodified><displayname>/</displayname><resourcetype><collection/></resourcetype></prop><status>HTTP/1.1 200 OK</status></propstat><propstat><prop xmlns:a0="http://apache.org/dav/props/"><executable xmlns="a0"/></prop><status>HTTP/1.1 404 Not Found</status></propstat></response></multistatus>HTTP/1.1 401 Unauthorized
+Date: Tue, 01 Mar 2005 15:30:04 GMT
+Content-Length: 0
+X-Powered-By: Zope (www.zope.org), Python (www.python.org)
+WWW-Authenticate: basic realm='Zope'
+Server: zope.server.http (DAVUserAgent)
+
+HTTP/1.1 201 Created
+Date: Tue, 01 Mar 2005 15:30:08 GMT
+Content-Length: 0
+X-Powered-By: Zope (www.zope.org), Python (www.python.org)
+Server: zope.server.http (DAVUserAgent)
+
+HTTP/1.1 207 Multi-Status
+Date: Tue, 01 Mar 2005 15:30:10 GMT
+Content-Length: 491
+X-Powered-By: Zope (www.zope.org), Python (www.python.org)
+Server: zope.server.http (DAVUserAgent)
+
+<?xml version="1.0" ?>
+<multistatus xmlns="DAV:"><response><href>http://localhost:9080/test</href><propstat><prop><getcontentlength>1 KB</getcontentlength><getlastmodified>Tue, 01 Mar 2005 15:30:08 GMT</getlastmodified><displayname>test</displayname><resourcetype></resourcetype></prop><status>HTTP/1.1 200 OK</status></propstat><propstat><prop xmlns:a0="http://apache.org/dav/props/"><executable xmlns="a0"/></prop><status>HTTP/1.1 404 Not Found</status></propstat></response></multistatus>HTTP/1.1 200 Ok
+Content-Length: 0
+Allow: GET, HEAD, POST, PUT, DELETE, OPTIONS, PROPFIND, MKCOL, LOCK, UNLOCK
+X-Powered-By: Zope (www.zope.org), Python (www.python.org)
+Date: Tue, 01 Mar 2005 15:30:10 GMT
+DAV: 1,2
+MS-Author-Via: DAV
+Server: zope.server.http (DAVUserAgent)
+
+HTTP/1.1 200 Ok
+Date: Tue, 01 Mar 2005 15:30:11 GMT
+Content-Length: 351
+Lock-Token: opaquelocktoken:1109691011.03
+X-Powered-By: Zope (www.zope.org), Python (www.python.org)
+Server: zope.server.http (DAVUserAgent)
+
+<?xml version="1.0" encoding="utf-8" ?>
+<prop xmlns="DAV:">
+<lockdiscovery>
+  <activelock>
+    <locktype><write/></locktype>
+    <lockscope><exclusive/></lockscope>
+    <depth>0</depth>
+    <owner></owner>
+    <timeout>Second-3600</timeout>
+    <locktoken><href>opaquelocktoken:1109691011.03</href></locktoken>
+  </activelock>
+</lockdiscovery>
+</prop>HTTP/1.1 200 Ok
+Date: Tue, 01 Mar 2005 15:30:11 GMT
+Content-Length: 20
+X-Powered-By: Zope (www.zope.org), Python (www.python.org)
+Server: zope.server.http (DAVUserAgent)
+
+This is a test file
+HTTP/1.1 200 Ok
+Date: Tue, 01 Mar 2005 15:30:19 GMT
+Content-Length: 0
+X-Powered-By: Zope (www.zope.org), Python (www.python.org)
+Server: zope.server.http (DAVUserAgent)
+
+HTTP/1.1 204 No Content
+Date: Tue, 01 Mar 2005 15:30:19 GMT
+Content-Length: 0
+X-Powered-By: Zope (www.zope.org), Python (www.python.org)
+Server: zope.server.http (DAVUserAgent)
+

Added: z3/davuseragent/trunk/ftests/dut.py
==============================================================================
--- (empty file)
+++ z3/davuseragent/trunk/ftests/dut.py	Tue Mar  1 16:45:56 2005
@@ -0,0 +1,16 @@
+"""XXX short summary goes here.
+
+$Id$
+"""
+import unittest
+from zope.app.tests.functional import FunctionalDocFileSuite
+from davuseragent.ftests.functional import http
+
+def test_suite():
+    globs = {'dav': http}
+    return FunctionalDocFileSuite('FILE',
+                                  package='davuseragent.ftests',
+                                  globs=globs)
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')

Added: z3/davuseragent/trunk/ftests/functional.py
==============================================================================
--- (empty file)
+++ z3/davuseragent/trunk/ftests/functional.py	Tue Mar  1 16:45:56 2005
@@ -0,0 +1,97 @@
+##############################################################################
+#
+# Copyright (c) 2003 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Modified excerpt from Zope X3.0's zope.app.tests.functional to
+support davuseragent requests."""
+import urllib
+import rfc822
+from StringIO import StringIO
+
+from transaction import commit
+from zope.publisher.publish import publish
+from zope.app.component.hooks import setSite, getSite
+from zope.app.tests.functional import FunctionalTestSetup, \
+    HTTPHeaderOutput, DocResponseWrapper, getRootFolder, \
+    split_header, auth_header
+
+from davuseragent.requestfactory import DAVUserAgentFactory
+
+HTTPTaskStub = StringIO
+
+def http(request_string, handle_errors=True):
+    """Execute an HTTP request string via the publisher
+
+    This is used for HTTP doc tests.  It works like its pendant in
+    zope.app.tests.functional except that this one executs the
+    davuseragent request factory."""
+    # Commit work done by previous python code.
+    commit()
+
+    # Discard leading white space to make call layout simpler
+    request_string = request_string.lstrip()
+
+    # split off and parse the command line
+    l = request_string.find('\n')
+    command_line = request_string[:l].rstrip()
+    request_string = request_string[l+1:]
+    method, path, protocol = command_line.split()
+    path = urllib.unquote(path)
+
+    instream = StringIO(request_string)
+    environment = {"HTTP_HOST": 'localhost',
+                   "HTTP_REFERER": 'localhost',
+                   "REQUEST_METHOD": method,
+                   "SERVER_PROTOCOL": protocol,
+                   }
+
+    headers = [split_header(header)
+               for header in rfc822.Message(instream).headers]
+    for name, value in headers:
+        name = ('_'.join(name.upper().split('-')))
+        if name not in ('CONTENT_TYPE', 'CONTENT_LENGTH'):
+            name = 'HTTP_' + name
+        environment[name] = value.rstrip()
+
+    auth_key = 'HTTP_AUTHORIZATION'
+    if environment.has_key(auth_key):
+        environment[auth_key] = auth_header(environment[auth_key])
+
+    outstream = HTTPTaskStub()
+
+
+    old_site = getSite()
+    setSite(None)
+    app = FunctionalTestSetup().getApplication()
+    header_output = HTTPHeaderOutput(
+        protocol, ('x-content-type-warning', 'x-powered-by'))
+
+    # acquire request and publication classes
+    factory = DAVUserAgentFactory(app.db)
+    request = factory(StringIO(request_string), StringIO(), environment)
+    request_cls = factory._request_cls
+    publication_cls = factory._publication_cls
+
+    request = app._request(path, instream, outstream,
+                           environment=environment,
+                           request=request_cls, publication=publication_cls)
+    request.response.setHeaderOutput(header_output)
+    response = DocResponseWrapper(request.response, outstream, path,
+                                  header_output)
+    
+    publish(request, handle_errors=handle_errors)
+    setSite(old_site)
+
+    # sync Python connection:
+    getRootFolder()._p_jar.sync()
+    
+    return response

Added: z3/davuseragent/trunk/ftests/test_cadaver.py
==============================================================================
--- (empty file)
+++ z3/davuseragent/trunk/ftests/test_cadaver.py	Tue Mar  1 16:45:56 2005
@@ -0,0 +1,16 @@
+"""XXX short summary goes here.
+
+$Id$
+"""
+import unittest
+from zope.app.tests.functional import FunctionalDocFileSuite
+from davuseragent.ftests.functional import http
+
+def test_suite():
+    globs = {'dav': http}
+    return FunctionalDocFileSuite('cadaver.txt',
+                                  package='davuseragent.ftests',
+                                  globs=globs)
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')

Modified: z3/davuseragent/trunk/requestfactory.py
==============================================================================
--- z3/davuseragent/trunk/requestfactory.py	(original)
+++ z3/davuseragent/trunk/requestfactory.py	Tue Mar  1 16:45:56 2005
@@ -3,6 +3,9 @@
 from zope.publisher.xmlrpc import XMLRPCRequest
 
 from zope.app.publication.httpfactory import HTTPPublicationRequestFactory
+from zope.app.publication.http import HTTPPublication
+from zope.app.publication.browser import BrowserPublication
+from zope.app.publication.xmlrpc import XMLRPCPublication
 
 _browser_methods = 'GET', 'POST', 'HEAD'
 
@@ -13,6 +16,17 @@
 
 class DAVUserAgentFactory(HTTPPublicationRequestFactory):
 
+    def __init__(self, db):
+        super(DAVUserAgentFactory, self).__init__(db)
+        self._request_cls = HTTPRequest
+        self._publication_cls = HTTPPublication
+
+    def makeRequest(self, request_cls, publication_cls, *args):
+        # remember the kind of request and publication class for tests
+        self._request_cls = request_cls
+        self._publication_cls = publication_cls
+        return request_cls(*args)
+
     def __call__(self, input_stream, output_steam, env):
         """See `zope.app.publication.interfaces.IPublicationRequestFactory`"""
         method = env.get('REQUEST_METHOD', 'GET').upper()
@@ -20,7 +34,8 @@
         # only make a distinction if we're dealing with browser
         # methods at all
         if method not in _browser_methods:
-            request = HTTPRequest(input_stream, output_steam, env)
+            request = self.makeRequest(HTTPRequest, HTTPPublication,
+                                       input_stream, output_steam, env)
             request.setPublication(self._http)
             return request
 
@@ -28,7 +43,8 @@
         is_xml = content_type.startswith('text/xml')
  
         if (method == 'POST' and is_xml):
-            request = XMLRPCRequest(input_stream, output_steam, env)
+            request= self.makeRequest(XMLRPCRequest, XMLRPCPublication,
+                                      input_stream, output_steam, env)
             request.setPublication(self._xmlrpc)
             return request
 
@@ -36,11 +52,13 @@
         user_agent = env.get('HTTP_USER_AGENT', '')
         # TODO saner detection logic
         if user_agent in _dav_user_agents:
-            request = HTTPRequest(input_stream, output_steam, env)
+            request = self.makeRequest(HTTPRequest, HTTPPublication,
+                                       input_stream, output_steam, env)
             request.setPublication(self._http)
             return request
 
         # fallback to a regular browser request
-        request = BrowserRequest(input_stream, output_steam, env)
-        request.setPublication(self._brower)
+        request = self.makeRequest(BrowserRequest, BrowserPublication,
+                                   input_stream, output_steam, env)
+        request.setPublication(self._brower) # typo in superclass
         return request


More information about the z3-checkins mailing list