Skip to content

Commit

Permalink
fixed linting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BrentBlanckaert committed Dec 17, 2024
1 parent 1db1db2 commit 4dedd8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tested/nat_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
)


def parse_value(value: list | str | int | float | dict, flattened_stack: dict) -> list | str | int | float | dict:
def parse_value(
value: list | str | int | float | dict, flattened_stack: dict
) -> list | str | int | float | dict:
if isinstance(value, str):
return format_string(value, flattened_stack)
elif isinstance(value, dict):
Expand Down
13 changes: 11 additions & 2 deletions tests/test_dsl_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1544,9 +1544,18 @@ def test_natural_translate_io_test():
print(translated_yaml)
assert translated_yaml.strip() == translated_yaml_str


def test_translate_parse():
flattened_stack = {"animal": "dier", "human": "mens", "number": "getal"}
value = {"key1": ["value1_{animal}", "value1_{human}"], "key2": "value2_{number}", "key3": 10}
expected_value = {"key1": ["value1_dier", "value1_mens"], "key2": "value2_getal", "key3": 10}
value = {
"key1": ["value1_{animal}", "value1_{human}"],
"key2": "value2_{number}",
"key3": 10,
}
expected_value = {
"key1": ["value1_dier", "value1_mens"],
"key2": "value2_getal",
"key3": 10,
}
parsed_result = parse_value(value, flattened_stack)
assert parsed_result == expected_value

0 comments on commit 4dedd8c

Please sign in to comment.