Skip to content

Commit

Permalink
test(project): update function names
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdoret committed Nov 3, 2023
1 parent 6a6cdf3 commit bfccff8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gimie/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 4 additions & 8 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bfccff8

Please sign in to comment.