Mercurial > hgsubversion
comparison tests/test_urls.py @ 467:3941d73c262e
svnwrappers: override svn+ssh credentials with supplied ones if any
svn+ssh URLs are special because the authentication layer is not handled by
svn, so they must contain the username to be resolved seamlessly. Until now,
credentials supplied from the command line were ignored when rewriting those
URLs. Fix that.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sat, 18 Jul 2009 20:44:33 -0500 |
parents | 35993ba9d119 |
children | 037bba1c6736 |
comparison
equal
deleted
inserted
replaced
466:9548b406a2d8 | 467:3941d73c262e |
---|---|
6 def test_standard_url(self): | 6 def test_standard_url(self): |
7 self.assertEqual((None, None, 'file:///var/svn/repo'), | 7 self.assertEqual((None, None, 'file:///var/svn/repo'), |
8 parse_url('file:///var/svn/repo')) | 8 parse_url('file:///var/svn/repo')) |
9 | 9 |
10 def test_user_url(self): | 10 def test_user_url(self): |
11 self.assertEqual(('joe', None, 'https://svn.testurl.com/repo'), | 11 self.assertEqual( |
12 parse_url('https://joe@svn.testurl.com/repo')) | 12 ('joe', None, 'https://svn.testurl.com/repo'), |
13 parse_url('https://joe@svn.testurl.com/repo')) | |
14 self.assertEqual( | |
15 ('bob', None, 'https://svn.testurl.com/repo'), | |
16 parse_url('https://joe@svn.testurl.com/repo', 'bob')) | |
13 | 17 |
14 def test_password_url(self): | 18 def test_password_url(self): |
15 self.assertEqual((None, 't3stpw', 'svn+ssh://svn.testurl.com/repo'), | 19 self.assertEqual( |
16 parse_url('svn+ssh://:t3stpw@svn.testurl.com/repo')) | 20 (None, 't3stpw', 'svn+ssh://svn.testurl.com/repo'), |
21 parse_url('svn+ssh://:t3stpw@svn.testurl.com/repo')) | |
22 self.assertEqual( | |
23 (None, '123abc', 'svn+ssh://svn.testurl.com/repo'), | |
24 parse_url('svn+ssh://:t3stpw@svn.testurl.com/repo', None, '123abc')) | |
17 | 25 |
18 def test_svnssh_preserve_user(self): | 26 def test_svnssh_preserve_user(self): |
19 self.assertEqual( | 27 self.assertEqual( |
20 ('user', 't3stpw', 'svn+ssh://user@svn.testurl.com/repo', ), | 28 ('user', 't3stpw', 'svn+ssh://user@svn.testurl.com/repo', ), |
21 parse_url('svn+ssh://user:t3stpw@svn.testurl.com/repo')) | 29 parse_url('svn+ssh://user:t3stpw@svn.testurl.com/repo')) |
22 self.assertEqual( | 30 self.assertEqual( |
31 ('bob', '123abc', 'svn+ssh://bob@svn.testurl.com/repo', ), | |
32 parse_url('svn+ssh://user:t3stpw@svn.testurl.com/repo', 'bob', '123abc')) | |
33 self.assertEqual( | |
23 ('user2', None, 'svn+ssh://user2@svn.testurl.com/repo', ), | 34 ('user2', None, 'svn+ssh://user2@svn.testurl.com/repo', ), |
24 parse_url('svn+ssh://user2@svn.testurl.com/repo')) | 35 parse_url('svn+ssh://user2@svn.testurl.com/repo')) |
36 self.assertEqual( | |
37 ('bob', None, 'svn+ssh://bob@svn.testurl.com/repo', ), | |
38 parse_url('svn+ssh://user2@svn.testurl.com/repo', 'bob')) | |
25 | 39 |
26 def test_user_password_url(self): | 40 def test_user_password_url(self): |
27 self.assertEqual(('joe', 't3stpw', 'https://svn.testurl.com/repo'), | 41 self.assertEqual( |
28 parse_url('https://joe:t3stpw@svn.testurl.com/repo')) | 42 ('joe', 't3stpw', 'https://svn.testurl.com/repo'), |
43 parse_url('https://joe:t3stpw@svn.testurl.com/repo')) | |
44 self.assertEqual( | |
45 ('bob', '123abc', 'https://svn.testurl.com/repo'), | |
46 parse_url('https://joe:t3stpw@svn.testurl.com/repo', 'bob', '123abc')) | |
29 | 47 |
30 | 48 |
31 def suite(): | 49 def suite(): |
32 all = [unittest.TestLoader().loadTestsFromTestCase(TestSubversionUrls)] | 50 all = [unittest.TestLoader().loadTestsFromTestCase(TestSubversionUrls)] |
33 return unittest.TestSuite(all) | 51 return unittest.TestSuite(all) |