-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move the tests of models into a separate folder and parameterize the …
…test of common utils
- Loading branch information
Kashyap Maheshwari
committed
Jun 11, 2023
1 parent
013046a
commit 80ce363
Showing
5 changed files
with
14 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +0,0 @@ | ||
import logging | ||
import os | ||
from typing import Optional | ||
|
||
from findpapers.tools.bibtex_generator_tool import generate_bibtex | ||
from findpapers.tools.downloader_tool import download | ||
from findpapers.tools.rayyan_tool import RayyanExport | ||
from findpapers.tools.refiner_tool import refine | ||
from findpapers.tools.refman_tool import RisExport | ||
from findpapers.tools.search_runner_tool import search | ||
|
||
try: | ||
import importlib.metadata as importlib_metadata | ||
except ModuleNotFoundError: | ||
import importlib_metadata | ||
|
||
__version__ = importlib_metadata.version(__name__) | ||
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
from findpapers.utils.common_utils import get_numeric_month_by_string | ||
|
||
import pytest | ||
|
||
def test_get_numeric_month_by_string_when_ful_form_of_string_is_provided() -> None: | ||
assert get_numeric_month_by_string(string="January") == "01" | ||
from findpapers.utils.common_utils import get_numeric_month_by_string | ||
|
||
|
||
def test_get_numeric_month_by_string_when_short_form_of_string_is_provided() -> None: | ||
assert get_numeric_month_by_string(string="Mar") == "03" | ||
@pytest.mark.parametrize(("month", "expected_output"), [("January", "01"), ("March", "03"), ("October", "10")]) | ||
def test_get_numeric_month_by_string_when_full_form_of_string_is_provided(month: str, expected_output: str) -> None: | ||
assert get_numeric_month_by_string(string=month) == expected_output | ||
|
||
|
||
def test_get_numeric_month_by_string_when_number_is_provided_as_string() -> None: | ||
assert get_numeric_month_by_string(string="12") == "12" | ||
@pytest.mark.parametrize(("month", "expected_output"), [("Feb", "02"), ("May", "05"), ("Nov", "11")]) | ||
def test_get_numeric_month_by_string_when_short_form_of_string_is_provided(month: str, expected_output: str) -> None: | ||
assert get_numeric_month_by_string(string=month) == expected_output | ||
|
||
|
||
def test_get_numeric_month_by_string_when_string_is_not_valid() -> None: | ||
assert get_numeric_month_by_string(string="15") == "01" | ||
assert get_numeric_month_by_string(string="fdgdf") == "01" | ||
@pytest.mark.parametrize(("month", "expected_output"), [("06", "06"), ("08", "08"), ("11", "11")]) | ||
def test_get_numeric_month_by_string_when_month_is_provided_as_number(month: str, expected_output: str) -> None: | ||
assert get_numeric_month_by_string(string=month) == expected_output | ||
|
||
|
||
def test_get_numeric_month_by_string_when_string_is_not_provided() -> None: | ||
assert get_numeric_month_by_string(string=None) == "01" | ||
@pytest.mark.parametrize("string", ["15", "fdgdf", None]) | ||
def test_get_numeric_month_by_string_when_string_is_not_valid(string: str) -> None: | ||
assert get_numeric_month_by_string(string=string) == "01" |