~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Test ConnectionError exceptions.

* bzrlib/transport/http/_urllib2_wrappers.py
(AbstractHTTPConnection.getresponse): Not needed anymore.
(AbstractHTTPHandler.do_open): Better exception handling.
(HTTPBasicAuthHandler): Not yet implemented.

* bzrlib/transport/http/_urllib.py: 
Fix spurious spaces.

* bzrlib/transport/http/__init__.py:
(WallRequestHandler, WallHttpServer): A http server closing
connections as soon as a request arrives.

* bzrlib/tests/test_http.py:
(TestWallServer): Check exceptions during connection.

* bzrlib/tests/HTTPTestUtil.py:
(TestCaseWithWallserver): New class. A server which close
connections as soon as possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    # In order to debug we have to issue our traces in sync with
50
50
    # httplib, which use print :(
51
51
    _debuglevel = 0
52
 
    
 
52
 
53
53
    _opener_class = Opener
54
54
 
55
55
    def __init__(self, base, from_transport=None):
133
133
        if ranges or tail_amount:
134
134
            bytes = 'bytes=' + self.range_header(ranges, tail_amount)
135
135
            headers = {'Range': bytes}
136
 
        
 
136
 
137
137
        request = Request('GET', abspath, None, headers)
138
138
        response = self._perform(request)
139
139