summaryrefslogtreecommitdiff
path: root/tests/test_vcs_subversion.py
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2012-02-16 21:09:00 +0100
committerJannis Leidel <jannis@leidel.info>2012-02-16 21:09:00 +0100
commitee554dd82b8bc6ed9a3cf989b353126580fcc082 (patch)
treeb0604f39ed465673316fe94ffa29046ed868aafc /tests/test_vcs_subversion.py
parent47f1b2c2b2523469e6107cb2ef325eb61fa8fcf1 (diff)
parent40ac381fad2cc31f75014f02d3e8bf755d933abb (diff)
downloadpip-1.1.tar.gz
Merge branch 'release/1.1'1.1
Diffstat (limited to 'tests/test_vcs_subversion.py')
-rw-r--r--tests/test_vcs_subversion.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_vcs_subversion.py b/tests/test_vcs_subversion.py
new file mode 100644
index 000000000..212220113
--- /dev/null
+++ b/tests/test_vcs_subversion.py
@@ -0,0 +1,21 @@
+from mock import patch
+from pip.vcs.subversion import Subversion
+from tests.test_pip import reset_env
+
+@patch('pip.vcs.subversion.call_subprocess')
+def test_obtain_should_recognize_auth_info_in_url(call_subprocess_mock):
+ env = reset_env()
+ svn = Subversion(url='svn+http://username:password@svn.example.com/')
+ svn.obtain(env.scratch_path/'test')
+ call_subprocess_mock.assert_called_with([
+ svn.cmd, 'checkout', '-q', '--username', 'username', '--password', 'password',
+ 'http://username:password@svn.example.com/', env.scratch_path/'test'])
+
+@patch('pip.vcs.subversion.call_subprocess')
+def test_export_should_recognize_auth_info_in_url(call_subprocess_mock):
+ env = reset_env()
+ svn = Subversion(url='svn+http://username:password@svn.example.com/')
+ svn.export(env.scratch_path/'test')
+ assert call_subprocess_mock.call_args[0] == ([
+ svn.cmd, 'export', '--username', 'username', '--password', 'password',
+ 'http://username:password@svn.example.com/', env.scratch_path/'test'],)