~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/http_utils.py

Merge cleanup into texinfo

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
    one. This will currently fail if the primary transport is not
107
107
    backed by regular disk files.
108
108
    """
 
109
 
 
110
    # This can be overriden or parametrized by daughter clasess if needed, but
 
111
    # it must exist so that the create_transport_readonly_server() method can
 
112
    # propagate it.
 
113
    _protocol_version = None
 
114
 
109
115
    def setUp(self):
110
116
        super(TestCaseWithWebserver, self).setUp()
111
117
        self.transport_readonly_server = http_server.HttpServer
112
118
 
 
119
    def create_transport_readonly_server(self):
 
120
        return self.transport_readonly_server(
 
121
            protocol_version=self._protocol_version)
 
122
 
113
123
 
114
124
class TestCaseWithTwoWebservers(TestCaseWithWebserver):
115
125
    """A support class providing readonly urls on two servers that are http://.
127
137
 
128
138
        This is mostly a hook for daughter classes.
129
139
        """
130
 
        return self.transport_secondary_server()
 
140
        return self.transport_secondary_server(
 
141
            protocol_version=self._protocol_version)
131
142
 
132
143
    def get_secondary_server(self):
133
144
        """Get the server instance for the secondary transport."""
218
229
   def create_transport_secondary_server(self):
219
230
       """Create the secondary server redirecting to the primary server"""
220
231
       new = self.get_readonly_server()
221
 
       redirecting = HTTPServerRedirecting()
 
232
       redirecting = HTTPServerRedirecting(
 
233
           protocol_version=self._protocol_version)
222
234
       redirecting.redirect_to(new.host, new.port)
223
235
       return redirecting
224
236