~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http.py

(gz) Create working tree at specified revision when doing a local push
 (Martin Packman)

Show diffs side-by-side

added added

removed removed

Lines of Context:
384
384
    _transport = property(_get_pycurl_maybe)
385
385
 
386
386
 
 
387
class TestHttpUrls(tests.TestCase):
 
388
 
 
389
    # TODO: This should be moved to authorization tests once they
 
390
    # are written.
 
391
 
 
392
    def test_url_parsing(self):
 
393
        f = FakeManager()
 
394
        url = http.extract_auth('http://example.com', f)
 
395
        self.assertEqual('http://example.com', url)
 
396
        self.assertEqual(0, len(f.credentials))
 
397
        url = http.extract_auth(
 
398
            'http://user:pass@example.com/bzr/bzr.dev', f)
 
399
        self.assertEqual('http://example.com/bzr/bzr.dev', url)
 
400
        self.assertEqual(1, len(f.credentials))
 
401
        self.assertEqual([None, 'example.com', 'user', 'pass'],
 
402
                         f.credentials[0])
 
403
 
 
404
 
387
405
class TestHttpTransportUrls(tests.TestCase):
388
406
    """Test the http urls."""
389
407
 
469
487
        )
470
488
 
471
489
    def setUp(self):
472
 
        super(TestHTTPConnections, self).setUp()
 
490
        http_utils.TestCaseWithWebserver.setUp(self)
473
491
        self.build_tree(['foo/', 'foo/bar'], line_endings='binary',
474
492
                        transport=self.get_transport())
475
493
 
1145
1163
                                      protocol_version=self._protocol_version)
1146
1164
 
1147
1165
    def setUp(self):
1148
 
        super(TestLimitedRangeRequestServer, self).setUp()
 
1166
        http_utils.TestCaseWithWebserver.setUp(self)
1149
1167
        # We need to manipulate ranges that correspond to real chunks in the
1150
1168
        # response, so we build a content appropriately.
1151
1169
        filler = ''.join(['abcdefghij' for x in range(102)])
1337
1355
        )
1338
1356
 
1339
1357
    def setUp(self):
1340
 
        super(TestRanges, self).setUp()
 
1358
        http_utils.TestCaseWithWebserver.setUp(self)
1341
1359
        self.build_tree_contents([('a', '0123456789')],)
1342
1360
 
1343
1361
    def create_transport_readonly_server(self):
2105
2123
    """
2106
2124
 
2107
2125
    def setUp(self):
 
2126
        tests.TestCase.setUp(self)
2108
2127
        self.server = self._activity_server(self._protocol_version)
2109
2128
        self.server.start_server()
2110
2129
        self.addCleanup(self.server.stop_server)
2247
2266
        )
2248
2267
 
2249
2268
    def setUp(self):
2250
 
        super(TestActivity, self).setUp()
2251
2269
        TestActivityMixin.setUp(self)
2252
2270
 
2253
2271
 
2262
2280
    _protocol_version = 'HTTP/1.1'
2263
2281
 
2264
2282
    def setUp(self):
2265
 
        super(TestNoReportActivity, self).setUp()
2266
2283
        self._transport =_urllib.HttpTransport_urllib
2267
2284
        TestActivityMixin.setUp(self)
2268
2285