~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/http_utils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-07 11:50:28 UTC
  • mfrom: (5147.4.7 more-colo)
  • Revision ID: pqm@pqm.ubuntu.com-20100507115028-tuuxmnormm8oetw6
(vila, for jelmer) Pass the colocated branch name along in more places,
        add extra tests.

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
 
 
115
109
    def setUp(self):
116
110
        super(TestCaseWithWebserver, self).setUp()
117
111
        self.transport_readonly_server = http_server.HttpServer
118
112
 
119
 
    def create_transport_readonly_server(self):
120
 
        return self.transport_readonly_server(
121
 
            protocol_version=self._protocol_version)
122
 
 
123
113
 
124
114
class TestCaseWithTwoWebservers(TestCaseWithWebserver):
125
115
    """A support class providing readonly urls on two servers that are http://.
137
127
 
138
128
        This is mostly a hook for daughter classes.
139
129
        """
140
 
        return self.transport_secondary_server(
141
 
            protocol_version=self._protocol_version)
 
130
        return self.transport_secondary_server()
142
131
 
143
132
    def get_secondary_server(self):
144
133
        """Get the server instance for the secondary transport."""
229
218
   def create_transport_secondary_server(self):
230
219
       """Create the secondary server redirecting to the primary server"""
231
220
       new = self.get_readonly_server()
232
 
       redirecting = HTTPServerRedirecting(
233
 
           protocol_version=self._protocol_version)
 
221
       redirecting = HTTPServerRedirecting()
234
222
       redirecting.redirect_to(new.host, new.port)
235
223
       return redirecting
236
224