/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_http_response.py

Support user.signingkey configuration variable in .git/config.

Merged from https://code.launchpad.net/~jelmer/brz/local-git-key/+merge/381000

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
  InvalidHttpResponse.
38
38
"""
39
39
 
40
 
from io import BytesIO
41
 
 
42
 
import http.client as http_client
43
 
 
44
 
parse_headers = http_client.parse_headers
 
40
try:
 
41
    import http.client as http_client
 
42
except ImportError:  # python < 3 without future
 
43
    import httplib as http_client
 
44
 
 
45
try:
 
46
    parse_headers = http_client.parse_headers
 
47
except AttributeError:  # python 2
 
48
    parse_headers = http_client.HTTPMessage
45
49
 
46
50
from .. import (
47
51
    errors,
48
52
    tests,
49
53
    )
 
54
from ..sixish import (
 
55
    BytesIO,
 
56
    PY3,
 
57
    )
50
58
from ..transport.http import (
51
59
    response,
52
60
    HTTPConnection,
718
726
        # Get rid of the status line
719
727
        status_and_headers.readline()
720
728
        msg = parse_headers(status_and_headers)
721
 
        return msg.get
 
729
        if PY3:
 
730
            return msg.get
 
731
        else:
 
732
            return msg.getheader
722
733
 
723
734
    def get_response(self, a_response):
724
735
        """Process a supplied response, and return the result."""