diff --git a/atest/json_lib.py b/atest/json_lib.py index d544b7c..d2e6966 100644 --- a/atest/json_lib.py +++ b/atest/json_lib.py @@ -4,11 +4,13 @@ from robot.api import logger -def compare_translations(file: Path) -> dict: - with Path(__file__).parent.parent.joinpath("robotframework_browser_translation_fi", "translation.json").open("r") as file_object: +def compare_translations(file: Path): + with Path(__file__).parent.parent.joinpath( + "robotframework_browser_translation_fi", "translation.json" + ).open("r") as file_object: expected_data = json.load(file_object) - expected_keywords = [kw["name"]for kw in expected_data.values()] - logger.info(expected_keywords) + expected_keywords = [kw["name"] for kw in expected_data.values()] + logger.info(f"expected_keywords: {expected_keywords}") with file.open("r") as file_object: data = json.load(file_object) keywords = data["keywords"] diff --git a/atest/translation.robot b/atest/translation.robot index e63a8cf..1e2905c 100644 --- a/atest/translation.robot +++ b/atest/translation.robot @@ -1,8 +1,8 @@ *** Settings *** Library Browser language=FI Library Process -Library OperatingSystem -Library json_lib.py +Library OperatingSystem +Library json_lib.py *** Test Cases *** Translation Works With Translation @@ -11,6 +11,12 @@ Translation Works With Translation LibDoc Works With Translation [Setup] Remove File ${CURDIR}/Browser.json ${json_kw_speck} = Join Path ${CURDIR} Browser.json - ${cmd} = Join Command Line python -m robot.libdoc --format=json Browser::language=FI ${json_kw_speck} + ${cmd} = Join Command Line + ... python + ... -m + ... robot.libdoc + ... --format=json + ... Browser::language=FI + ... ${json_kw_speck} Run Process ${cmd} shell=True Compare Translations ${json_kw_speck} diff --git a/pyproject.toml b/pyproject.toml index 558780c..14b7a65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,9 +70,6 @@ exclude = ''' lint.unfixable = [] exclude = [ "__pycache__", - "generated", - "wrapper", - "browser.pyi", ] target-version = "py38" lint.select = [ @@ -106,6 +103,7 @@ lint.select = [ [tool.ruff.lint.per-file-ignores] "tasks.py" = ["T201"] "utest/*" = ["INP001"] +"atest/*" = ["INP001"] [tool.pytest.ini_options] testpaths = ["utest"] @@ -121,3 +119,8 @@ configure = [ "RenameTestCases:enabled=True:capitalize_each_word=True", "RenameKeywords:enabled=True", ] + +[tool.mypy] +exclude = [ + "utest/*", +] diff --git a/utest/test_translation.py b/utest/test_translation.py index e3b403c..3475c33 100644 --- a/utest/test_translation.py +++ b/utest/test_translation.py @@ -55,4 +55,4 @@ def test_keyword_names_are_unique(data: dict): def test_keyword_names_no_space(data: robotframework_browser_translation_fi.Language): for translation, value in data.items(): assert " " not in translation, translation - assert " " not in value["name"] + assert " " not in value["name"], value