@@ -92,6 +92,39 @@ def test_install_report_index(script: PipTestEnvironment, tmp_path: Path) -> Non
92
92
assert "requires_dist" in paste_report ["metadata" ]
93
93
94
94
95
+ @pytest .mark .network
96
+ def test_install_report_direct_archive (
97
+ script : PipTestEnvironment , tmp_path : Path , shared_data : TestData
98
+ ) -> None :
99
+ """Test report for direct URL archive."""
100
+ report_path = tmp_path / "report.json"
101
+ script .pip (
102
+ "install" ,
103
+ str (shared_data .root / "packages" / "simplewheel-1.0-py2.py3-none-any.whl" ),
104
+ "--dry-run" ,
105
+ "--no-index" ,
106
+ "--report" ,
107
+ str (report_path ),
108
+ )
109
+ report = json .loads (report_path .read_text ())
110
+ assert "install" in report
111
+ assert len (report ["install" ]) == 1
112
+ simplewheel_report = _install_dict (report )["simplewheel" ]
113
+ assert simplewheel_report ["metadata" ]["name" ] == "simplewheel"
114
+ assert simplewheel_report ["requested" ] is True
115
+ assert simplewheel_report ["is_direct" ] is True
116
+ url = simplewheel_report ["download_info" ]["url" ]
117
+ assert url .startswith ("file://" )
118
+ assert url .endswith ("/packages/simplewheel-1.0-py2.py3-none-any.whl" )
119
+ assert (
120
+ simplewheel_report ["download_info" ]["archive_info" ]["hash" ]
121
+ == "sha256=e63aa139caee941ec7f33f057a5b987708c2128238357cf905429846a2008718"
122
+ )
123
+ assert simplewheel_report ["download_info" ]["archive_info" ]["hashes" ] == {
124
+ "sha256" : "e63aa139caee941ec7f33f057a5b987708c2128238357cf905429846a2008718"
125
+ }
126
+
127
+
95
128
@pytest .mark .network
96
129
def test_install_report_vcs_and_wheel_cache (
97
130
script : PipTestEnvironment , tmp_path : Path
0 commit comments