From 8144be3dd72f07c5b49ce4df2378e5395c0507a7 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Wed, 1 Nov 2023 11:48:40 +0100 Subject: [PATCH] Fix: ebuild tests Remove a wrong line from the example list for gentoo and fix the test to run over the whole file --- tests/models/packages/gentoo_examples.txt | 1 - tests/models/packages/test_ebuild.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/models/packages/gentoo_examples.txt b/tests/models/packages/gentoo_examples.txt index dfff701d..2e2c1d18 100644 --- a/tests/models/packages/gentoo_examples.txt +++ b/tests/models/packages/gentoo_examples.txt @@ -27989,7 +27989,6 @@ net-analyzer/squidview-0.86 net-analyzer/nethogs-0.8.6-r1 net-analyzer/sshping-0.1.4 net-analyzer/nfdump-1.6.23 -/mnt/gentoo/var/db/repos/gentoo/skel.ebuild sec-policy/selinux-gatekeeper-2.20210203-r1 sec-policy/selinux-gatekeeper-2.20210908-r1 sec-policy/selinux-gatekeeper-9999 diff --git a/tests/models/packages/test_ebuild.py b/tests/models/packages/test_ebuild.py index bc8f00f6..73b6af88 100644 --- a/tests/models/packages/test_ebuild.py +++ b/tests/models/packages/test_ebuild.py @@ -19,9 +19,9 @@ def test_parse_fullname(self): with (currentp / "gentoo_examples.txt").open( "r", encoding="utf-8" ) as file: - fullname = file.readline() - if not EBuildPackage.from_full_name(fullname): - self.fail(f"{fullname} is not parsable for EBuildPackage.") + for fullname in file.readlines(): + if not EBuildPackage.from_full_name(fullname): + self.fail(f"{fullname} is not parsable for EBuildPackage.") def test_guard(self): self.assertIsNone(EBuildPackage.from_full_name(""))