2015-01-15 00:53:15 +01:00
|
|
|
import pytest
|
2012-01-31 11:42:53 +01:00
|
|
|
from mock import patch
|
2017-06-13 14:17:00 +02:00
|
|
|
|
2017-08-31 17:48:18 +02:00
|
|
|
from pip._internal.vcs.subversion import Subversion
|
2012-01-31 11:42:53 +01:00
|
|
|
|
2012-05-14 05:13:50 +02:00
|
|
|
|
2017-08-31 17:48:18 +02:00
|
|
|
@patch('pip._internal.vcs.call_subprocess')
|
2015-01-15 00:53:15 +01:00
|
|
|
@pytest.mark.network
|
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/')
|
2014-02-24 22:52:23 +01:00
|
|
|
svn.obtain(script.scratch_path / 'test')
|
2015-03-10 12:28:09 +01:00
|
|
|
assert call_subprocess_mock.call_args[0][0] == [
|
|
|
|
svn.name, 'checkout', '-q', '--username', 'username', '--password',
|
2016-05-26 12:43:26 +02:00
|
|
|
'password', 'http://svn.example.com/',
|
2014-02-24 22:52:23 +01:00
|
|
|
script.scratch_path / 'test',
|
2015-03-10 12:28:09 +01:00
|
|
|
]
|
2012-01-31 11:56:47 +01:00
|
|
|
|
2012-05-14 05:13:50 +02:00
|
|
|
|
2017-08-31 17:48:18 +02:00
|
|
|
@patch('pip._internal.vcs.call_subprocess')
|
2015-01-15 00:53:15 +01:00
|
|
|
@pytest.mark.network
|
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/')
|
2014-02-24 22:52:23 +01:00
|
|
|
svn.export(script.scratch_path / 'test')
|
2015-03-10 12:28:09 +01:00
|
|
|
assert call_subprocess_mock.call_args[0][0] == [
|
|
|
|
svn.name, 'export', '--username', 'username', '--password',
|
2016-05-26 12:43:26 +02:00
|
|
|
'password', 'http://svn.example.com/',
|
2015-03-10 12:28:09 +01:00
|
|
|
script.scratch_path / 'test',
|
|
|
|
]
|