Skip to content

Commit

Permalink
test: default value parsing on the env var parser
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade committed Dec 26, 2023
1 parent 45a6622 commit a895a04
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/test_helpers/test_env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,37 @@ def test_match_export_parse_consistency(export_data, template) -> None:
assert parsed_data == export_data


@pytest.mark.parametrize(
("template", "parsed"),
argvalues=[
(
{"value": "${str:john}"},
{"value": "john"},
),
(
{"value": "${int:3}"},
{"value": 3},
),
(
{"value": "${bool:false}"},
{"value": False},
),
(
{"value": '${list:["foo","bar"]}'},
{"value": ["foo", "bar"]},
),
(
{"value": '${dict:{"foo":"bar"}}'},
{"value": {"foo": "bar"}},
),
],
)
def test_parse_defaults(template, parsed) -> None:
"""Test default value parsing."""
parsed_data = apply_env_variables(template, env_variables={})
assert parsed_data == parsed


def test_apply_env_variables_on_agent_config():
"""Test apply_env_variables_on_agent_config function."""
result = apply_env_variables_on_agent_config(
Expand Down

0 comments on commit a895a04

Please sign in to comment.