From bfccff8928135ea3f11d136393f1f943b767def0 Mon Sep 17 00:00:00 2001 From: cmdoret Date: Fri, 3 Nov 2023 18:44:11 +0100 Subject: [PATCH] test(project): update function names --- gimie/project.py | 2 +- tests/test_project.py | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/gimie/project.py b/gimie/project.py index ed446a7..404bc43 100644 --- a/gimie/project.py +++ b/gimie/project.py @@ -123,7 +123,7 @@ def check_parser_names(parser_names: Iterable[str]): Examples -------- - >>> check_parsers(["license"]) + >>> check_parser_names(["license"]) """ for parser_name in parser_names: diff --git a/tests/test_project.py b/tests/test_project.py index 8e6b874..e4319e5 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -2,23 +2,19 @@ import pytest from gimie.extractors import GIT_PROVIDERS -from gimie.project import get_parsers, get_extractor +from gimie.project import check_parser_names, get_extractor from gimie.parsers import PARSERS -def test_get_parsers(): - - repo = "https://example.org/group/project" - for name, parser in PARSERS.items(): - assert type(get_parsers(repo, [name])[0]) == parser +def test_check_parser_names(): + check_parser_names(PARSERS.keys()) # Should raise error if parser not found with pytest.raises(ValueError): - get_parsers(repo, ["bad_parser"]) + check_parser_names(["bad_parser"]) def test_get_extractor(): - repo = "https://example.org/group/project" for prov, extractor in GIT_PROVIDERS.items(): assert type(get_extractor(repo, prov)) == extractor