@@ -176,6 +176,16 @@ def egg_path(arch: str, pyver: str | None, tmp_path: Path) -> str:
176176 return str (bdist_path )
177177
178178
179+ @pytest .fixture
180+ def expected_wheel_filename (pyver : str | None , arch : str ) -> str :
181+ if arch != "any" :
182+ pyver = pyver .replace ("." , "" ) if pyver else "py2.py3"
183+ abiver = pyver .replace ("py" , "cp" )
184+ return f"sampledist-1.0.0-{ pyver } -{ abiver } -{ arch } .whl"
185+ else :
186+ return "sampledist-1.0.0-py2.py3-none-any.whl"
187+
188+
179189def test_egg_re () -> None :
180190 """Make sure egg_info_re matches."""
181191 egg_names_path = os .path .join (os .path .dirname (__file__ ), "eggnames.txt" )
@@ -191,10 +201,12 @@ def test_convert_egg_file(
191201 tmp_path : Path ,
192202 arch : str ,
193203 expected_wheelfile : bytes ,
204+ expected_wheel_filename : str ,
194205 capsys : CaptureFixture ,
195206) -> None :
196207 convert ([egg_path ], str (tmp_path ), verbose = True )
197208 wheel_path = next (path for path in tmp_path .iterdir () if path .suffix == ".whl" )
209+ assert wheel_path .name == expected_wheel_filename
198210 with WheelFile (wheel_path ) as wf :
199211 assert wf .read ("sampledist-1.0.0.dist-info/METADATA" ) == EXPECTED_METADATA
200212 assert wf .read ("sampledist-1.0.0.dist-info/WHEEL" ) == expected_wheelfile
@@ -207,8 +219,10 @@ def test_convert_egg_directory(
207219 egg_path : str ,
208220 tmp_path : Path ,
209221 tmp_path_factory : TempPathFactory ,
222+ pyver : str | None ,
210223 arch : str ,
211224 expected_wheelfile : bytes ,
225+ expected_wheel_filename : str ,
212226 capsys : CaptureFixture ,
213227) -> None :
214228 with zipfile .ZipFile (egg_path ) as egg_file :
@@ -218,6 +232,7 @@ def test_convert_egg_directory(
218232
219233 convert ([str (egg_dir_path )], str (tmp_path ), verbose = True )
220234 wheel_path = next (path for path in tmp_path .iterdir () if path .suffix == ".whl" )
235+ assert wheel_path .name == expected_wheel_filename
221236 with WheelFile (wheel_path ) as wf :
222237 assert wf .read ("sampledist-1.0.0.dist-info/METADATA" ) == EXPECTED_METADATA
223238 assert wf .read ("sampledist-1.0.0.dist-info/WHEEL" ) == expected_wheelfile
@@ -231,10 +246,12 @@ def test_convert_bdist_wininst(
231246 tmp_path : Path ,
232247 arch : str ,
233248 expected_wheelfile : bytes ,
249+ expected_wheel_filename : str ,
234250 capsys : CaptureFixture ,
235251) -> None :
236252 convert ([bdist_wininst_path ], str (tmp_path ), verbose = True )
237253 wheel_path = next (path for path in tmp_path .iterdir () if path .suffix == ".whl" )
254+ assert wheel_path .name == expected_wheel_filename
238255 with WheelFile (wheel_path ) as wf :
239256 assert (
240257 wf .read ("sampledist-1.0.0.data/scripts/somecommand" )
0 commit comments