~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/_pycurl.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:
220
220
            mutter('got pycurl error: %s, %s, %s, url: %s ',
221
221
                    e[0], _pycurl_errors.errorcode[e[0]], e, url)
222
222
            if e[0] in (_pycurl_errors.CURLE_COULDNT_RESOLVE_HOST,
223
 
                        _pycurl_errors.CURLE_COULDNT_CONNECT):
 
223
                        _pycurl_errors.CURLE_COULDNT_CONNECT,
 
224
                        _pycurl_errors.CURLE_GOT_NOTHING):
224
225
                self._raise_curl_connection_error(curl)
225
226
            # jam 20060713 The code didn't use to re-raise the exception here
226
227
            # but that seemed bogus