Skip to content

Commit

Permalink
Test that RECORD is populated correctly for data files
Browse files Browse the repository at this point in the history
  • Loading branch information
chrahunt committed Jul 5, 2020
1 parent 56871a2 commit 3f96af3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/functional/test_install_wheel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-

import csv
import distutils
import glob
import os
Expand Down Expand Up @@ -282,6 +283,28 @@ def test_wheel_record_lines_in_deterministic_order(script, data):
assert record_lines == sorted(record_lines)


def test_wheel_record_lines_have_hash_for_data_files(script):
package = make_wheel(
"simple",
"0.1.0",
extra_data_files={
"purelib/info.txt": "c",
},
).save_to_dir(script.scratch_path)
script.pip("install", package)
record_file = (
script.site_packages_path / "simple-0.1.0.dist-info" / "RECORD"
)
record_text = record_file.read_text()
record_rows = list(csv.reader(record_text.splitlines()))
records = {
r[0]: r[1:] for r in record_rows
}
assert records["info.txt"] == [
"sha256=Ln0sA6lQeuJl7PW1NWiFpTOTogKdJBOUmXJloaJa78Y", "1"
]


@pytest.mark.incompatible_with_test_venv
def test_install_user_wheel(script, shared_data, with_wheel, tmpdir):
"""
Expand Down

0 comments on commit 3f96af3

Please sign in to comment.