Skip to content

Commit

Permalink
updated to pydantic v2, added kosovo
Browse files Browse the repository at this point in the history
  • Loading branch information
signalkraft committed Jan 3, 2025
1 parent 3fdad0f commit 7ecf831
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build~=1.2.1
freezegun~=1.5.1
country_list~=1.1.0
requests~=2.31.0
pydantic<1.11.0
pydantic~=2.10.4
mypy~=1.8.0
types-requests~=2.32.0.20240712
types-PyYAML~=6.0.12.12
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ classifiers = [
]
dependencies = [
"aiohttp>=3.8.0",
"pydantic<1.11.0",
"pydantic~=2.10.4",
]
dynamic = ["version"]

Expand Down
1 change: 1 addition & 0 deletions src/myPyllant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"hungary": "Hungary",
"ireland": "Ireland",
"italy": "Italy",
"kosovo": "Kosovo",
"latvia": "Latvia",
"lithuania": "Lithuania",
"luxembourg": "Luxembourg",
Expand Down
7 changes: 6 additions & 1 deletion src/myPyllant/tests/find_countries.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@


def countries_with_realm(brand):
for code, country in country_list.countries_for_language("en"):
country_codes = country_list.countries_for_language("en") + [
("XK", "Kosovo"),
]
country_codes.sort(key=lambda x: x[1])

for code, country in country_codes:
if code == "CZ":
country_name = "czechrepublic"
elif code == "TR":
Expand Down
5 changes: 4 additions & 1 deletion src/myPyllant/tests/test_countries.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ async def test_find_countries(mocker) -> None:
)
with mock.patch("requests.head") as patched_head:
patched_head.return_value.status_code = 200
assert list(countries_with_realm("vaillant")) == [("germany", "Germany")]
assert list(countries_with_realm("vaillant")) == [
("germany", "Germany"),
("kosovo", "Kosovo"),
]
patched_head.return_value.status_code = 404
assert list(countries_with_realm("vaillant")) == []

0 comments on commit 7ecf831

Please sign in to comment.