~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http.py

Merge http-leaks into sftp-leaks

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
                            _qualified_prefix='http+pycurl',)))
91
91
    tests.multiply_tests(t_tests, transport_scenarios, result)
92
92
 
 
93
    protocol_scenarios = [
 
94
            ('HTTP/1.0',  dict(_protocol_version='HTTP/1.0')),
 
95
            ('HTTP/1.1',  dict(_protocol_version='HTTP/1.1')),
 
96
            ]
 
97
 
 
98
    # some tests are parametrized by the protocol version only
 
99
    p_tests, remaining_tests = tests.split_suite_by_condition(
 
100
        remaining_tests, tests.condition_isinstance((
 
101
                TestAuthOnRedirected,
 
102
                )))
 
103
    tests.multiply_tests(p_tests, protocol_scenarios, result)
 
104
 
93
105
    # each implementation tested with each HTTP version
94
106
    tp_tests, remaining_tests = tests.split_suite_by_condition(
95
107
        remaining_tests, tests.condition_isinstance((
104
116
                TestRanges,
105
117
                TestSpecificRequestHandler,
106
118
                )))
107
 
    protocol_scenarios = [
108
 
            ('HTTP/1.0',  dict(_protocol_version='HTTP/1.0')),
109
 
            ('HTTP/1.1',  dict(_protocol_version='HTTP/1.1')),
110
 
            ]
111
119
    tp_scenarios = tests.multiply_scenarios(transport_scenarios,
112
120
                                            protocol_scenarios)
113
121
    tests.multiply_tests(tp_tests, tp_scenarios, result)
2153
2161
    _transport = _urllib.HttpTransport_urllib
2154
2162
 
2155
2163
    def create_transport_readonly_server(self):
2156
 
        return self._auth_server()
 
2164
        return self._auth_server(protocol_version=self._protocol_version)
2157
2165
 
2158
2166
    def create_transport_secondary_server(self):
2159
2167
        """Create the secondary server redirecting to the primary server"""
2160
2168
        new = self.get_readonly_server()
2161
2169
 
2162
 
        redirecting = http_utils.HTTPServerRedirecting()
 
2170
        redirecting = http_utils.HTTPServerRedirecting(
 
2171
            protocol_version=self._protocol_version)
2163
2172
        redirecting.redirect_to(new.host, new.port)
2164
2173
        return redirecting
2165
2174