Assert that repo_url_path doesn't exist.

This commit is contained in:
Chris Jerdonek 2019-09-21 02:29:38 -07:00
parent 144051e422
commit 1ca61e14ba
2 changed files with 5 additions and 3 deletions

View File

@ -276,12 +276,13 @@ def test_git_with_tag_name_and_update(script, tmpdir):
Test cloning a git repository and updating to a different version.
"""
url_path = 'pypa/pip-test-package.git'
local_url = _github_checkout(url_path, tmpdir, egg='pip-test-package')
base_local_url = _github_checkout(url_path, tmpdir)
local_url = '{}#egg=pip-test-package'.format(base_local_url)
result = script.pip('install', '-e', local_url)
result.assert_installed('pip-test-package', with_files=['.git'])
new_local_url = _github_checkout(url_path, tmpdir)
new_local_url += '@0.1.2#egg=pip-test-package'
new_local_url = '{}@0.1.2#egg=pip-test-package'.format(base_local_url)
result = script.pip(
'install', '--global-option=--version', '-e', new_local_url,
)

View File

@ -66,6 +66,7 @@ def local_checkout(
else:
repository_name = os.path.basename(remote_repo)
repo_url_path = os.path.join(directory, repository_name)
assert not os.path.exists(repo_url_path)
vcs_backend = vcs.get_backend(vcs_name)
vcs_backend.obtain(repo_url_path, url=hide_url(remote_repo))