Skip to content

Commit

Permalink
Update tests/test_api_data.py
Browse files Browse the repository at this point in the history
yea, thanks! I am not used to pytest yet.

Co-authored-by: Johannes Aschauer <[email protected]>
  • Loading branch information
wingechr and joAschauer authored Nov 21, 2023
1 parent f31fd02 commit 48ee49b
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/test_api_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@ def test_get_parameter_value(
assert expected == pytest.approx(result)


def test_get_dimensions_parameter_code(ptxdata_static):
code = ptxdata_static.get_dimensions_parameter_code("country", "Germany")
assert code == "DEU"

code = ptxdata_static.get_dimensions_parameter_code("country", "")
assert code == ""

code = ptxdata_static.get_dimensions_parameter_code("country", None)
assert code == ""

code = ptxdata_static.get_dimensions_parameter_code(
"secproc_water", "Specific costs"
)
assert code == ""
@pytest.mark.parametrize(
"dimension, parameter_name, expected_code",
(
("country", "Germany", "DEU"),
("country", "", ""),
("country", None, ""),
("secproc_water", "Specific costs", ""),
),
)
def test_get_dimensions_parameter_code(
ptxdata_static, dimension, parameter_name, expected_code
):
out_code = ptxdata_static.get_dimensions_parameter_code(dimension, parameter_name)
assert out_code == expected_code

0 comments on commit 48ee49b

Please sign in to comment.