55
66import pytest
77
8- from pip ._internal .exceptions import BadCommand , InstallationError
9- from pip ._internal .utils .misc import hide_url , hide_value
10- from pip ._internal .vcs import make_vcs_requirement_url
11- from pip ._internal .vcs .bazaar import Bazaar
12- from pip ._internal .vcs .git import Git , RemoteNotValidError , looks_like_hash
13- from pip ._internal .vcs .mercurial import Mercurial
14- from pip ._internal .vcs .subversion import Subversion
15- from pip ._internal .vcs .versioncontrol import RevOptions , VersionControl
8+ from fetchcode . vcs . pip ._internal .exceptions import BadCommand , InstallationError
9+ from fetchcode . vcs . pip ._internal .utils .misc import hide_url , hide_value
10+ from fetchcode . vcs . pip ._internal .vcs import make_vcs_requirement_url
11+ from fetchcode . vcs . pip ._internal .vcs .bazaar import Bazaar
12+ from fetchcode . vcs . pip ._internal .vcs .git import Git , RemoteNotValidError , looks_like_hash
13+ from fetchcode . vcs . pip ._internal .vcs .mercurial import Mercurial
14+ from fetchcode . vcs . pip ._internal .vcs .subversion import Subversion
15+ from fetchcode . vcs . pip ._internal .vcs .versioncontrol import RevOptions , VersionControl
1616from tests .lib import is_svn_installed , need_svn
1717
1818
@@ -153,7 +153,7 @@ def test_git_remote_url_to_pip(url, target):
153153def test_paths_are_not_mistaken_for_scp_shorthand (url , platform ):
154154 # File paths should not be mistaken for SCP shorthand. If they do then
155155 # 'c:/piffle/wiffle' would end up as 'ssh://c/piffle/wiffle'.
156- from pip ._internal .vcs .git import SCP_REGEX
156+ from fetchcode . vcs . pip ._internal .vcs .git import SCP_REGEX
157157 assert not SCP_REGEX .match (url )
158158
159159 if platform == os .name :
@@ -168,9 +168,9 @@ def test_git_remote_local_path(tmpdir):
168168 assert Git ._git_remote_to_pip_url (str (path )) == path .as_uri ()
169169
170170
171- @patch ('pip._internal.vcs.git.Git.get_remote_url' )
172- @patch ('pip._internal.vcs.git.Git.get_revision' )
173- @patch ('pip._internal.vcs.git.Git.get_subdirectory' )
171+ @patch ('fetchcode.vcs. pip._internal.vcs.git.Git.get_remote_url' )
172+ @patch ('fetchcode.vcs. pip._internal.vcs.git.Git.get_revision' )
173+ @patch ('fetchcode.vcs. pip._internal.vcs.git.Git.get_subdirectory' )
174174@pytest .mark .parametrize (
175175 "git_url, target_url_prefix" ,
176176 [
@@ -202,7 +202,7 @@ def test_git_get_src_requirements(
202202 assert ret == target
203203
204204
205- @patch ('pip._internal.vcs.git.Git.get_revision_sha' )
205+ @patch ('fetchcode.vcs. pip._internal.vcs.git.Git.get_revision_sha' )
206206def test_git_resolve_revision_rev_exists (get_sha_mock ):
207207 get_sha_mock .return_value = ('123456' , False )
208208 url = 'git+https://git.example.com'
@@ -212,7 +212,7 @@ def test_git_resolve_revision_rev_exists(get_sha_mock):
212212 assert new_options .rev == '123456'
213213
214214
215- @patch ('pip._internal.vcs.git.Git.get_revision_sha' )
215+ @patch ('fetchcode.vcs. pip._internal.vcs.git.Git.get_revision_sha' )
216216def test_git_resolve_revision_rev_not_found (get_sha_mock ):
217217 get_sha_mock .return_value = (None , False )
218218 url = 'git+https://git.example.com'
@@ -222,7 +222,7 @@ def test_git_resolve_revision_rev_not_found(get_sha_mock):
222222 assert new_options .rev == 'develop'
223223
224224
225- @patch ('pip._internal.vcs.git.Git.get_revision_sha' )
225+ @patch ('fetchcode.vcs. pip._internal.vcs.git.Git.get_revision_sha' )
226226def test_git_resolve_revision_not_found_warning (get_sha_mock , caplog ):
227227 get_sha_mock .return_value = (None , False )
228228 url = 'git+https://git.example.com'
@@ -253,7 +253,7 @@ def test_git_resolve_revision_not_found_warning(get_sha_mock, caplog):
253253 ('foo' , False ),
254254 (None , False ),
255255))
256- @patch ('pip._internal.vcs.git.Git.get_revision' )
256+ @patch ('fetchcode.vcs. pip._internal.vcs.git.Git.get_revision' )
257257def test_git_is_commit_id_equal (mock_get_revision , rev_name , result ):
258258 """
259259 Test Git.is_commit_id_equal().
@@ -379,7 +379,7 @@ def test_version_control__run_command__fails(vcs_cls, exc_cls, msg_re):
379379 when the command is not found or when the user have no permission
380380 to execute it. The error message must contains the command name.
381381 """
382- with patch ("pip._internal.vcs.versioncontrol.call_subprocess" ) as call :
382+ with patch ("fetchcode.vcs. pip._internal.vcs.versioncontrol.call_subprocess" ) as call :
383383 call .side_effect = exc_cls
384384 with pytest .raises (BadCommand , match = msg_re .format (name = vcs_cls .name )):
385385 vcs_cls .run_command ([])
@@ -533,7 +533,7 @@ def test_subversion__call_vcs_version():
533533 ('svn, version . .' , ()),
534534 ('' , ()),
535535])
536- @patch ('pip._internal.vcs.subversion.Subversion.run_command' )
536+ @patch ('fetchcode.vcs. pip._internal.vcs.subversion.Subversion.run_command' )
537537def test_subversion__call_vcs_version_patched (
538538 mock_run_command , svn_output , expected_version ):
539539 """
@@ -544,7 +544,7 @@ def test_subversion__call_vcs_version_patched(
544544 assert version == expected_version
545545
546546
547- @patch ('pip._internal.vcs.subversion.Subversion.run_command' )
547+ @patch ('fetchcode.vcs. pip._internal.vcs.subversion.Subversion.run_command' )
548548def test_subversion__call_vcs_version_svn_not_installed (mock_run_command ):
549549 """
550550 Test Subversion.call_vcs_version() when svn is not installed.
@@ -574,7 +574,7 @@ def test_subversion__get_vcs_version_cached(version):
574574 (1 , 7 ),
575575 (1 , 8 , 0 ),
576576])
577- @patch ('pip._internal.vcs.subversion.Subversion.call_vcs_version' )
577+ @patch ('fetchcode.vcs. pip._internal.vcs.subversion.Subversion.call_vcs_version' )
578578def test_subversion__get_vcs_version_call_vcs (mock_call_vcs , vcs_version ):
579579 """
580580 Test Subversion.get_vcs_version() with mocked output from
@@ -608,7 +608,7 @@ def test_subversion__get_remote_call_options(
608608
609609class TestSubversionArgs (TestCase ):
610610 def setUp (self ):
611- patcher = patch ('pip._internal.vcs.versioncontrol.call_subprocess' )
611+ patcher = patch ('fetchcode.vcs. pip._internal.vcs.versioncontrol.call_subprocess' )
612612 self .addCleanup (patcher .stop )
613613 self .call_subprocess_mock = patcher .start ()
614614
0 commit comments