From 5dd3895a9a5e4564d261b8d52beef5363c56475b Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 5 Jun 2024 17:38:20 +0300 Subject: [PATCH] Fixed blacklist type Signed-off-by: Dimitris Zlatanidis --- slpkg/blacklist.py | 6 +++--- tests/test_blacklist.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/slpkg/blacklist.py b/slpkg/blacklist.py index 13419e4e..02bc9cb1 100644 --- a/slpkg/blacklist.py +++ b/slpkg/blacklist.py @@ -22,14 +22,14 @@ class Blacklist(Configs): # pylint: disable=[R0903] self.toml_errors = TomlErrors() self.blacklist_file_toml: Path = Path(self.etc_path, 'blacklist.toml') - def packages(self) -> tuple: + def packages(self) -> list: """Read the blacklist file.""" - packages: tuple = tuple() + packages: list = [] if self.blacklist_file_toml.is_file(): try: with open(self.blacklist_file_toml, 'rb') as black_file: black: dict = {k.lower(): v for k, v in tomli.load(black_file).items()} - packages: tuple = black['packages'] + packages: list = black['packages'] except (tomli.TOMLDecodeError, KeyError) as error: print() self.toml_errors.raise_toml_error_message(error, self.blacklist_file_toml) diff --git a/tests/test_blacklist.py b/tests/test_blacklist.py index 852047e6..6f814ef2 100644 --- a/tests/test_blacklist.py +++ b/tests/test_blacklist.py @@ -8,7 +8,7 @@ class TestBlacklist(unittest.TestCase): def test_blacklist(self) -> None: """Test blacklist packages.""" black = Blacklist() - self.assertTupleEqual((), black.packages()) + self.assertListEqual([], black.packages()) if __name__ == '__main__':