Skip to content

Commit 4335def

Browse files
committed
Add test capturing expectation where versionless metadata exists but hasn't been updated to the new normalization technique. Ref #261.
1 parent dd25a38 commit 4335def

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/fixtures.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ class DistInfoPkgWithDotLegacy(OnSysPath, SiteDir):
127127
Version: 1.0.0
128128
""",
129129
},
130+
"pkg.lot.egg-info": {
131+
"METADATA": """
132+
Name: pkg.lot
133+
Version: 1.0.0
134+
""",
135+
},
130136
}
131137

132138
def setUp(self):

tests/test_api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ def test_name_normalization(self):
174174
with self.subTest(name):
175175
assert distribution(name).metadata['Name'] == 'pkg.dot'
176176

177+
def test_name_normalization_versionless_egg_info(self):
178+
names = 'pkg.lot', 'pkg_lot', 'pkg-lot', 'pkg..lot', 'Pkg.Lot'
179+
for name in names:
180+
with self.subTest(name):
181+
assert distribution(name).metadata['Name'] == 'pkg.lot'
182+
177183

178184
class OffSysPathTests(fixtures.DistInfoPkgOffPath, unittest.TestCase):
179185
def test_find_distributions_specified_path(self):

0 commit comments

Comments
 (0)