Explicitly test that header file was created as-expected

Since this is the special part of this test. This gives us more
confidence that we're doing the right thing when removing the standalone
wheel file next.
This commit is contained in:
Chris Hunt 2020-07-03 13:42:15 -04:00
parent feb2a24f14
commit 00191b2db1
1 changed files with 16 additions and 0 deletions

View File

@ -145,6 +145,16 @@ def test_basic_install_from_unicode_wheel(script, data):
result.did_create(file2)
def get_header_scheme_path_for_script(script, dist_name):
command = (
"from pip._internal.locations import get_scheme;"
"scheme = get_scheme({!r});"
"print(scheme.headers);"
).format(dist_name)
result = script.run('python', '-c', command).stdout
return Path(result.strip())
def test_install_from_wheel_with_headers(script, data):
"""
Test installing from a wheel file with headers
@ -154,6 +164,12 @@ def test_install_from_wheel_with_headers(script, data):
dist_info_folder = script.site_packages / 'headers.dist-0.1.dist-info'
result.did_create(dist_info_folder)
header_scheme_path = get_header_scheme_path_for_script(
script, 'headers.dist'
)
header_path = header_scheme_path / 'header.h'
assert header_path.read_text() == ''
def test_install_wheel_with_target(script, shared_data, with_wheel, tmpdir):
"""