Skip to content

Commit

Permalink
refactor test
Browse files Browse the repository at this point in the history
  • Loading branch information
honzajavorek committed Oct 3, 2024
1 parent 26b2b38 commit 9767681
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/test_lib_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,18 @@ def test_get_region_from_country():


@pytest.mark.parametrize(
"country",
"region, country, expected",
[
"Česko",
"Česká republika",
("Středočeský kraj", "Česko", "Praha"),
("Středočeský kraj", "Česká republika", "Praha"),
("Praha", "Česko", "Praha"),
("Praha", "Česká republika", "Praha"),
],
)
def test_get_region_from_region(country):
address = dict(region="Středočeský kraj", country=country)
def test_get_region_from_region(region: str, country: str, expected: str):
address = dict(region=region, country=country)

assert get_region(address) == "Praha"
assert get_region(address) == expected


GEOCODED_ADDRESS = {
Expand All @@ -91,7 +93,7 @@ def test_get_region_from_region(country):


@pytest.mark.parametrize(
"location_raw,expected",
"location_raw, expected",
[
("252 30 Řevnice, Česko", GEOCODED_ADDRESS),
(
Expand Down

0 comments on commit 9767681

Please sign in to comment.