summaryrefslogtreecommitdiff
path: root/tests/test_vcs_subversion.py
blob: 2122201135ec5c34bbc6829cea7787578d6aa4d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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'],)