From 43afaebc2d2eca353045e34d029bdc0ebc1f9099 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 14 Aug 2021 15:23:49 -0400 Subject: [PATCH] Add failing test illustrating missed expectation. Ref #330. --- tests/fixtures.py | 2 +- tests/test_main.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/fixtures.py b/tests/fixtures.py index 03c44006..a5be07c8 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -301,7 +301,7 @@ class ZipFixtures: def _fixture_on_path(self, filename): pkg_file = resources.files(self.root).joinpath(filename) file = self.resources.enter_context(resources.as_file(pkg_file)) - assert file.name.startswith('example-'), file.name + assert file.name.startswith('example'), file.name sys.path.insert(0, str(file)) self.resources.callback(sys.path.pop, 0) diff --git a/tests/test_main.py b/tests/test_main.py index af9615eb..8426c48f 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -289,3 +289,11 @@ class PackagesDistributionsTest(fixtures.ZipFixtures, unittest.TestCase): def test_packages_distributions_example(self): self._fixture_on_path('example-21.12-py3-none-any.whl') assert packages_distributions()['example'] == ['example'] + + def test_packages_distributions_example2(self): + """ + Test packages_distributions on a wheel built + by trampolim. + """ + self._fixture_on_path('example2-1.0.0-py3-none-any.whl') + assert packages_distributions()['example2'] == ['example2']