Skip to content

Commit 4461855

Browse files
committed
Add some (failing) tests for _name_from_stem. Ref #377
1 parent b06c382 commit 4461855

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

importlib_metadata/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,14 @@ def _normalized_name(self):
960960

961961
@staticmethod
962962
def _name_from_stem(stem):
963+
"""
964+
>>> PathDistribution._name_from_stem('foo-3.0.egg-info')
965+
'foo'
966+
>>> PathDistribution._name_from_stem('CherryPy-3.0.dist-info')
967+
'CherryPy'
968+
>>> PathDistribution._name_from_stem('face.egg-info')
969+
'face'
970+
"""
963971
_, ext = os.path.splitext(stem)
964972
if ext not in ('.dist-info', '.egg-info'):
965973
return

0 commit comments

Comments
 (0)