Test download editable

This commit is contained in:
Stéphane Bidoul 2020-11-12 12:59:42 +01:00
parent a88c84dfae
commit 9613c887f1
No known key found for this signature in database
GPG Key ID: BCAB2555446B5B92
1 changed files with 16 additions and 0 deletions

View File

@ -849,3 +849,19 @@ def test_download_http_url_bad_hash(
assert len(requests) == 1
assert requests[0]['PATH_INFO'] == '/simple-1.0.tar.gz'
assert requests[0]['HTTP_ACCEPT_ENCODING'] == 'identity'
def test_download_editable(script, data, tmpdir):
"""
Test 'pip download' of editables in requirement file.
"""
editable_path = os.path.join(data.src, 'simplewheel-1.0')
requirements_path = tmpdir / "requirements.txt"
requirements_path.write_text("-e " + str(editable_path.resolve()) + "\n")
download_dir = tmpdir / "download_dir"
script.pip(
'download', '--no-deps', '-r', str(requirements_path), '-d', str(download_dir)
)
downloads = os.listdir(download_dir)
assert len(downloads) == 1
assert downloads[0].endswith(".zip")