Skip to content

Commit 87cb86e

Browse files
committed
Added unit tests to verify correct normalization of package name
1 parent 7bcccbd commit 87cb86e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/functional/test_install_wheel.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import distutils
22
import glob
3+
import json
34
import os
45
import shutil
56

@@ -587,3 +588,18 @@ def test_wheel_install_fails_with_badly_encoded_metadata(script):
587588
assert "Error decoding metadata for" in result.stderr
588589
assert "simple-0.1.0-py2.py3-none-any.whl" in result.stderr
589590
assert "METADATA" in result.stderr
591+
592+
593+
@pytest.mark.parametrize(
594+
'package_name',
595+
['simple-package', 'simple_package'],
596+
)
597+
def test_correct_package_name_while_creating_wheel_bug(script, package_name):
598+
"""Check that the package name is correctly parsed and listed
599+
while creating a .whl file with a given format and installing it
600+
"""
601+
package = create_basic_wheel_for_package(script, package_name, '1.0')
602+
script.pip("install", "--no-cache-dir", "--no-index", package)
603+
result = script.pip('list', '--format=json')
604+
assert {"name": "simple-package", "version": "1.0"} \
605+
in json.loads(result.stdout)

0 commit comments

Comments
 (0)