~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/_urllib2_wrappers.py

Better (but still incomplete) design for bogus servers.

* bzrlib/transport/http/_urllib2_wrappers.py:
(AbstractHTTPHandler): Add 'Accept: */*' again to default headers
until I fully understand why and when it's needed or not (curl add
it if no Accept header is present).

* bzrlib/transport/http/_pycurl.py:
(PyCurlTransport._curl_perform): CURLE_GOT_NOTHING may be
considered as a ConnectionError, inspection of curl code reveals
that the case is sufficiently rare and low level related to not be
considered an http error per se.

* bzrlib/transport/http/__init__.py:
(WallHttpServer): Deleted.

* bzrlib/tests/test_http.py:
(TestBogusServer): Factor out the tests common to the bogus
servers.

* bzrlib/tests/__init__.py:
(TestCaseWithTransport.create_transport_server,
TestCaseWithTransport.create_transport_readonly_server): New
methods, allows test cases to specify the transport servers
without defining useless classes.
(TestCaseWithTransport.get_readonly_server): Use
create_transport_readonly_server.
(TestCaseWithTransport.get_server): Use create_transport_server.

* bzrlib/tests/HTTPTestUtil.py:
(TestCaseWithWebserver): Fix typo in doc string.
(TestCaseWithWallserver): Deleted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
                        'Cache-control': 'max-age=0',
260
260
                        'Connection': 'Keep-Alive',
261
261
                        'User-Agent': 'bzr/%s (urllib)' % bzrlib_version,
 
262
                        # FIXME: pycurl also set the following, understand why
 
263
                        'Accept': '*/*',
262
264
                        }
263
265
 
264
266
    def __init__(self):