~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http.py

  • Committer: Vincent Ladeuil
  • Date: 2010-02-11 09:27:55 UTC
  • mfrom: (5017.3.46 test-servers)
  • mto: This revision was merged to the branch mainline in revision 5030.
  • Revision ID: v.ladeuil+lp@free.fr-20100211092755-3vvu4vbwiwjjte3s
Move tests servers from bzrlib.transport to bzrlib.tests.test_server

Show diffs side-by-side

added added

removed removed

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