2012-01-31 11:42:53 +01:00
|
|
|
from mock import patch
|
|
|
|
from pip.vcs.subversion import Subversion
|
|
|
|
|
2012-05-14 05:13:50 +02:00
|
|
|
|
2012-01-31 11:42:53 +01:00
|
|
|
@patch('pip.vcs.subversion.call_subprocess')
|
2013-08-22 06:40:46 +02:00
|
|
|
def test_obtain_should_recognize_auth_info_url(call_subprocess_mock, script):
|
2012-01-31 11:42:53 +01:00
|
|
|
svn = Subversion(url='svn+http://username:password@svn.example.com/')
|
2013-08-22 06:40:46 +02:00
|
|
|
svn.obtain(script.scratch_path/'test')
|
2012-01-31 11:42:53 +01:00
|
|
|
call_subprocess_mock.assert_called_with([
|
2012-01-31 11:56:47 +01:00
|
|
|
svn.cmd, 'checkout', '-q', '--username', 'username', '--password', 'password',
|
2013-08-22 06:40:46 +02:00
|
|
|
'http://username:password@svn.example.com/', script.scratch_path/'test'])
|
2012-01-31 11:56:47 +01:00
|
|
|
|
2012-05-14 05:13:50 +02:00
|
|
|
|
2012-01-31 11:56:47 +01:00
|
|
|
@patch('pip.vcs.subversion.call_subprocess')
|
2013-08-22 06:40:46 +02:00
|
|
|
def test_export_should_recognize_auth_info_url(call_subprocess_mock, script):
|
2012-01-31 11:56:47 +01:00
|
|
|
svn = Subversion(url='svn+http://username:password@svn.example.com/')
|
2013-08-22 06:40:46 +02:00
|
|
|
svn.export(script.scratch_path/'test')
|
2012-01-31 11:56:47 +01:00
|
|
|
assert call_subprocess_mock.call_args[0] == ([
|
|
|
|
svn.cmd, 'export', '--username', 'username', '--password', 'password',
|
2013-08-22 06:40:46 +02:00
|
|
|
'http://username:password@svn.example.com/', script.scratch_path/'test'],)
|