Skip to content

Commit ff911fb

Browse files
committed
mypy ?
1 parent 092789a commit ff911fb

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/opengeodeweb_back/test_utils.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@
1010

1111

1212
def test_route_wrong_params(
13-
client: FlaskClient, route: str, get_full_data: Callable[[], JsonData], path: list = []
13+
client: FlaskClient,
14+
route: str,
15+
get_full_data: Callable[[], JsonData],
16+
path: list[str | int] | None = None,
1417
) -> None:
15-
def get_json():
18+
if path is None:
19+
path = []
20+
21+
def get_json() -> tuple[JsonData, Any]:
1622
json = get_full_data()
17-
target = json
23+
target: Any = json
1824
for p in path:
1925
target = target[p]
2026
return json, target
@@ -26,7 +32,7 @@ def get_json():
2632
target.pop(key)
2733
response = client.post(route, json=json)
2834
if response.status_code == 400:
29-
error_description = response.get_json()["description"]
35+
error_description: str = response.get_json()["description"]
3036
assert "must contain" in error_description
3137
assert f"'{key}'" in error_description
3238
if isinstance(value, (dict, list)):

0 commit comments

Comments
 (0)