annotate tests/test_urls.py @ 326:33736e2e25f0

alternate approach for supporting svn schemes for repository paths We now intercept the operations in the local repo class, and handle the relevant operation ourselves. This frees us from wrapping all relevant commands and replicating their functionality. The implementation is incomplete; only one test has been modified to use the standard Mercurial API with the changed URLs. Once changed, those tests will likely reveal bugs or missing features in the new wrappers. Also, new wrappers will be needed for handling conversion flags such as -A/--authormap.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Thu, 07 May 2009 20:50:53 +0200
parents 2969a20e0eef
children 46e69be8e2c8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
235
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
1 import test_util
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
2 import unittest
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
3 from svnwrap.svn_swig_wrapper import parse_url
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
4
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
5 class TestSubversionUrls(test_util.TestBase):
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
6 def test_standard_url(self):
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
7 self.assertEqual((None, None, 'file:///var/svn/repo'),
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
8 parse_url('file:///var/svn/repo'))
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
9
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
10 def test_user_url(self):
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
11 self.assertEqual(('joe', None, 'https://svn.testurl.com/repo'),
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
12 parse_url('https://joe@svn.testurl.com/repo'))
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
13
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
14 def test_password_url(self):
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
15 self.assertEqual((None, 't3stpw', 'svn+ssh://svn.testurl.com/repo'),
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
16 parse_url('svn+ssh://:t3stpw@svn.testurl.com/repo'))
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
17
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
18 def test_user_password_url(self):
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
19 self.assertEqual(('joe', 't3stpw', 'https://svn.testurl.com/repo'),
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
20 parse_url('https://joe:t3stpw@svn.testurl.com/repo'))
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
21
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
22
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
23 def suite():
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
24 all = [unittest.TestLoader().loadTestsFromTestCase(TestSubversionUrls)]
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents:
diff changeset
25 return unittest.TestSuite(all)