~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/HTTPTestUtil.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-30 18:21:02 UTC
  • mfrom: (3059.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20071130182102-i0t564k01anm7uk2
Fix bug #172701 by catching the pycurl ShortReadvError and allowing readv to issue several get requests

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
        return TestingHTTPRequestHandler.get_multiple_ranges(self, file,
165
165
                                                             file_size, ranges)
166
166
 
167
 
    def do_GET(self):
168
 
        tcs = self.server.test_case_server
169
 
        tcs.GET_request_nb += 1
170
 
        return TestingHTTPRequestHandler.do_GET(self)
171
 
 
172
167
 
173
168
class LimitedRangeHTTPServer(HttpServer):
174
169
    """An HttpServer erroring out on requests with too much range specifiers"""
177
172
                 range_limit=None):
178
173
        HttpServer.__init__(self, request_handler)
179
174
        self.range_limit = range_limit
180
 
        self.GET_request_nb = 0
181
175
 
182
176
 
183
177
class SingleRangeRequestHandler(TestingHTTPRequestHandler):
208
202
class NoRangeRequestHandler(TestingHTTPRequestHandler):
209
203
    """Ignore range requests without notice"""
210
204
 
211
 
    # Just bypass the range handling done by TestingHTTPRequestHandler
212
 
    do_GET = SimpleHTTPRequestHandler.do_GET
 
205
    def do_GET(self):
 
206
        # Update the statistics
 
207
        self.server.test_case_server.GET_request_nb += 1
 
208
        # Just bypass the range handling done by TestingHTTPRequestHandler
 
209
        return SimpleHTTPRequestHandler.do_GET(self)
213
210
 
214
211
 
215
212
class TestCaseWithWebserver(TestCaseWithTransport):