Fold obtain and export tests into TestSubversionArgs TestCase
@@ -6,34 +6,6 @@ from pip._internal.vcs import RevOptions
from pip._internal.vcs.subversion import Subversion
-@patch('pip._internal.vcs.call_subprocess')
-def test_obtain_should_recognize_auth_info_url(call_subprocess_mock, script):
- url = 'svn+http://username:password@svn.example.com/'
- # use_interactive is set to False to test that remote call options are
- # properly added.
- svn = Subversion(use_interactive=False)
- svn.obtain(script.scratch_path / 'test', url=url)
- assert call_subprocess_mock.call_args[0][0] == [
- svn.name, 'checkout', '-q', '--non-interactive', '--username',
- 'username', '--password', 'password', 'http://svn.example.com/',
- script.scratch_path / 'test',
- ]
-
-
-@patch('pip._internal.vcs.call_subprocess')
-def test_export_should_recognize_auth_info_url(call_subprocess_mock, script):
- url = 'svn+http://username:password@svn.example.com/'
- # use_interactive is set to False to test that remote call options are
- # properly added.
- svn = Subversion(use_interactive=False)
- svn.export(script.scratch_path / 'test', url=url)
- assert call_subprocess_mock.call_args[0][0] == [
- svn.name, 'export', '--non-interactive', '--username', 'username',
- '--password', 'password', 'http://svn.example.com/',
- script.scratch_path / 'test',
- ]
-
-
class TestSubversionArgs(TestCase):
def setUp(self):
patcher = patch('pip._internal.vcs.call_subprocess')
@@ -51,6 +23,20 @@ class TestSubversionArgs(TestCase):
def assert_call_args(self, args):
assert self.call_subprocess_mock.call_args[0][0] == args
+ def test_obtain(self):
+ self.svn.obtain(self.dest, self.url)
+ self.assert_call_args(
+ ['svn', 'checkout', '-q', '--non-interactive', '--username',
+ 'username', '--password', 'password',
+ 'http://svn.example.com/', '/tmp/test'])
+
+ def test_export(self):
+ self.svn.export(self.dest, self.url)
+ self.assert_call_args(
+ ['svn', 'export', '--non-interactive', '--username', 'username',
+ '--password', 'password', 'http://svn.example.com/',
+ '/tmp/test'])
+
def test_fetch_new(self):
self.svn.fetch_new(self.dest, self.url, self.rev_options)
self.assert_call_args(
