41
41
url = extract_auth('http://example.com', f)
42
42
self.assertEquals('http://example.com', url)
43
43
self.assertEquals(0, len(f.credentials))
44
url = extract_auth('http://user:pass@www.bazaar-ng.org/bzr/bzr.dev', f)
45
self.assertEquals('http://www.bazaar-ng.org/bzr/bzr.dev', url)
44
url = extract_auth('http://user:pass@www.bazaar-vcs.org/bzr/bzr.dev', f)
45
self.assertEquals('http://www.bazaar-vcs.org/bzr/bzr.dev', url)
46
46
self.assertEquals(1, len(f.credentials))
47
self.assertEquals([None, 'www.bazaar-ng.org', 'user', 'pass'], f.credentials[0])
47
self.assertEquals([None, 'www.bazaar-vcs.org', 'user', 'pass'], f.credentials[0])
49
49
def test_abs_url(self):
50
50
"""Construction of absolute http URLs"""
51
t = HttpTransport_urllib('http://bazaar-ng.org/bzr/bzr.dev/')
51
t = HttpTransport_urllib('http://bazaar-vcs.org/bzr/bzr.dev/')
52
52
eq = self.assertEqualDiff
54
'http://bazaar-ng.org/bzr/bzr.dev')
54
'http://bazaar-vcs.org/bzr/bzr.dev')
55
55
eq(t.abspath('foo/bar'),
56
'http://bazaar-ng.org/bzr/bzr.dev/foo/bar')
56
'http://bazaar-vcs.org/bzr/bzr.dev/foo/bar')
57
57
eq(t.abspath('.bzr'),
58
'http://bazaar-ng.org/bzr/bzr.dev/.bzr')
58
'http://bazaar-vcs.org/bzr/bzr.dev/.bzr')
59
59
eq(t.abspath('.bzr/1//2/./3'),
60
'http://bazaar-ng.org/bzr/bzr.dev/.bzr/1/2/3')
60
'http://bazaar-vcs.org/bzr/bzr.dev/.bzr/1/2/3')
62
62
def test_invalid_http_urls(self):
63
63
"""Trap invalid construction of urls"""
64
t = HttpTransport_urllib('http://bazaar-ng.org/bzr/bzr.dev/')
64
t = HttpTransport_urllib('http://bazaar-vcs.org/bzr/bzr.dev/')
65
65
self.assertRaises(ValueError,