From b69d165faf14563e9a005556336c6230516904c9 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Wed, 27 Mar 2019 17:22:11 -0700 Subject: [PATCH] Update tests --- packaging_scripts/tests/test_pkgfiles.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packaging_scripts/tests/test_pkgfiles.py b/packaging_scripts/tests/test_pkgfiles.py index 5ba1717..52a59dd 100644 --- a/packaging_scripts/tests/test_pkgfiles.py +++ b/packaging_scripts/tests/test_pkgfiles.py @@ -93,9 +93,19 @@ class TestGetSigfiles(unittest.TestCase): class TestFilterPkgfiles(unittest.TestCase): def test_yield(self): result = pkgfiles.filter(ALL_PKGFILES) - expected = [s for s in get_all_files() if re.match(PKGREGEX, str(s))] + expected = [s for s in ALL_PKGFILES if re.match(PKGREGEX, str(s))] + expected.sort() - self.assertListEqual(list(result), expected) + self.assertListEqual(sorted(result), expected) + self.assertIsInstance(result, GeneratorType) + + def test_yield_duplicate(self): + duplicate_info = ['package.pkg.tar.xz', 'package.pkg.tar.xz'] + + result = pkgfiles.filter(duplicate_info) + expected = [Path('package.pkg.tar.xz')] + + self.assertListEqual(sorted(result), expected) self.assertIsInstance(result, GeneratorType)