Skip to content

Commit 7bdbb57

Browse files
committed
Add test to ensure that a prefix isn't matched
1 parent 595eb5f commit 7bdbb57

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ def test_name_normalization(self):
5252
with self.subTest(name):
5353
assert distribution(name).metadata['Name'] == 'pkg.dot'
5454

55+
def test_prefix_not_matched(self):
56+
prefixes = 'p', 'pkg', 'pkg.'
57+
for prefix in prefixes:
58+
with self.subTest(prefix):
59+
with self.assertRaises(PackageNotFoundError):
60+
distribution(prefix)
61+
5562
def test_for_top_level(self):
5663
self.assertEqual(
5764
distribution('egginfo-pkg').read_text('top_level.txt').strip(),

0 commit comments

Comments
 (0)