diff tests/test_urls.py @ 468:037bba1c6736

svnrepo: expose the same svnurl than SubversionRepo Since the ssh+svn URLs depend on supplied credentials, and because we want to get the actual SVN URL without talking to the remote repository, we duplicate the work done by SubversionRepo.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 18 Jul 2009 20:44:33 -0500
parents 3941d73c262e
children 5567af673f83
line wrap: on
line diff
--- a/tests/test_urls.py
+++ b/tests/test_urls.py
@@ -1,6 +1,7 @@
 import test_util
 import unittest
 from hgsubversion.svnwrap.svn_swig_wrapper import parse_url
+from hgsubversion import svnrepo
 
 class TestSubversionUrls(test_util.TestBase):
     def test_standard_url(self):
@@ -45,6 +46,12 @@ class TestSubversionUrls(test_util.TestB
             ('bob', '123abc', 'https://svn.testurl.com/repo'),
             parse_url('https://joe:t3stpw@svn.testurl.com/repo', 'bob', '123abc'))
 
+class TestSvnRepo(test_util.TestBase):
+    def test_url_rewriting(self):
+        ui = test_util.ui.ui()
+        ui.setconfig('hgsubversion', 'username', 'bob')
+        repo = svnrepo.svnremoterepo(ui, 'svn+ssh://joe@foo/bar')
+        self.assertEqual('svn+ssh://bob@foo/bar', repo.svnurl)
 
 def suite():
     all = [unittest.TestLoader().loadTestsFromTestCase(TestSubversionUrls)]