~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_wsgi.py

  • Committer: Andrew Bennetts
  • Date: 2008-04-07 08:20:13 UTC
  • mfrom: (3340 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3344.
  • Revision ID: andrew.bennetts@canonical.com-20080407082013-ca1n1tqqon7ugxiy
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
        self.assertEqual('405 Method not allowed', self.status)
84
84
        self.assertTrue(('Allow', 'POST') in self.headers)
85
85
        
86
 
    def _fake_make_request(self, transport, write_func, bytes):
 
86
    def _fake_make_request(self, transport, write_func, bytes, rcp):
87
87
        request = FakeRequest(transport, write_func)
88
88
        request.accept_bytes(bytes)
89
89
        self.request = request
106
106
        })
107
107
        iterable = wsgi_app(environ, self.start_response)
108
108
        response = self.read_response(iterable)
109
 
        self.assertEqual([('clone', 'foo/bar')] , transport.calls)
 
109
        self.assertEqual([('clone', 'foo/bar/')] , transport.calls)
110
110
 
111
111
    def test_smart_wsgi_app_request_and_response(self):
112
112
        # SmartWSGIApp reads the smart request from the 'wsgi.input' file-like
179
179
        backing_transport = app.app.backing_transport
180
180
        chroot_backing_transport = backing_transport.server.backing_transport
181
181
        self.assertEndsWith(chroot_backing_transport.base, 'a%20root/')
182
 
        self.assertEqual(app.prefix, 'a prefix')
 
182
        self.assertEqual(app.app.root_client_path, 'a prefix')
183
183
        self.assertEqual(app.path_var, 'a path_var')
184
184
 
185
185
    def test_incomplete_request(self):
186
186
        transport = FakeTransport()
187
187
        wsgi_app = wsgi.SmartWSGIApp(transport)
188
 
        def make_request(transport, write_func, bytes):
 
188
        def make_request(transport, write_func, bytes, root_client_path):
189
189
            request = IncompleteRequest(transport, write_func)
190
190
            request.accept_bytes(bytes)
191
191
            self.request = request