Skip to content

Commit f00d5c3

Browse files
committed
Add test capturing failure. Ref #344.
1 parent 15df009 commit f00d5c3

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

tests/test_main.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def test_unicode_dir_on_sys_path(self):
285285
list(distributions())
286286

287287

288-
class PackagesDistributionsTest(fixtures.ZipFixtures, unittest.TestCase):
288+
class PackagesDistributionsPrebuiltTest(fixtures.ZipFixtures, unittest.TestCase):
289289
def test_packages_distributions_example(self):
290290
self._fixture_on_path('example-21.12-py3-none-any.whl')
291291
assert packages_distributions()['example'] == ['example']
@@ -297,3 +297,24 @@ def test_packages_distributions_example2(self):
297297
"""
298298
self._fixture_on_path('example2-1.0.0-py3-none-any.whl')
299299
assert packages_distributions()['example2'] == ['example2']
300+
301+
302+
class PackagesDistributionsTest(
303+
fixtures.OnSysPath, fixtures.SiteDir, unittest.TestCase
304+
):
305+
def test_packages_distributions_neither_toplevel_nor_files(self):
306+
"""
307+
Test a package built without 'top-level.txt' or a file list.
308+
"""
309+
fixtures.build_files(
310+
{
311+
'trim_example-1.0.0.dist-info': {
312+
'METADATA': """
313+
Name: trim_example
314+
Version: 1.0.0
315+
""",
316+
}
317+
},
318+
prefix=self.site_dir,
319+
)
320+
packages_distributions()

0 commit comments

Comments
 (0)