355
355
def test_abs_url(self):
356
356
"""Construction of absolute http URLs"""
357
t = self._transport('http://bazaar-vcs.org/bzr/bzr.dev/')
357
t = self._transport('http://example.com/bzr/bzr.dev/')
358
358
eq = self.assertEqualDiff
359
eq(t.abspath('.'), 'http://bazaar-vcs.org/bzr/bzr.dev')
360
eq(t.abspath('foo/bar'), 'http://bazaar-vcs.org/bzr/bzr.dev/foo/bar')
361
eq(t.abspath('.bzr'), 'http://bazaar-vcs.org/bzr/bzr.dev/.bzr')
359
eq(t.abspath('.'), 'http://example.com/bzr/bzr.dev')
360
eq(t.abspath('foo/bar'), 'http://example.com/bzr/bzr.dev/foo/bar')
361
eq(t.abspath('.bzr'), 'http://example.com/bzr/bzr.dev/.bzr')
362
362
eq(t.abspath('.bzr/1//2/./3'),
363
'http://bazaar-vcs.org/bzr/bzr.dev/.bzr/1/2/3')
363
'http://example.com/bzr/bzr.dev/.bzr/1/2/3')
365
365
def test_invalid_http_urls(self):
366
366
"""Trap invalid construction of urls"""
367
self._transport('http://bazaar-vcs.org/bzr/bzr.dev/')
367
self._transport('http://example.com/bzr/bzr.dev/')
368
368
self.assertRaises(errors.InvalidURL,
370
'http://http://bazaar-vcs.org/bzr/bzr.dev/')
370
'http://http://example.com/bzr/bzr.dev/')
372
372
def test_http_root_urls(self):
373
373
"""Construction of URLs from server root"""
374
t = self._transport('http://bzr.ozlabs.org/')
374
t = self._transport('http://example.com/')
375
375
eq = self.assertEqualDiff
376
376
eq(t.abspath('.bzr/tree-version'),
377
'http://bzr.ozlabs.org/.bzr/tree-version')
377
'http://example.com/.bzr/tree-version')
379
379
def test_http_impl_urls(self):
380
380
"""There are servers which ask for particular clients to connect"""