Skip to content

Commit

Permalink
chore: lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aaltat committed Apr 5, 2024
1 parent 02b26b3 commit 06aa7b9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
10 changes: 6 additions & 4 deletions atest/json_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
12 changes: 9 additions & 3 deletions atest/translation.robot
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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}
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ exclude = '''
lint.unfixable = []
exclude = [
"__pycache__",
"generated",
"wrapper",
"browser.pyi",
]
target-version = "py38"
lint.select = [
Expand Down Expand Up @@ -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"]
Expand All @@ -121,3 +119,8 @@ configure = [
"RenameTestCases:enabled=True:capitalize_each_word=True",
"RenameKeywords:enabled=True",
]

[tool.mypy]
exclude = [
"utest/*",
]
2 changes: 1 addition & 1 deletion utest/test_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 06aa7b9

Please sign in to comment.