Skip to content

Commit 04f0e79

Browse files
committed
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWeb-Back into fix/collection_components
2 parents 536bbf5 + b626d17 commit 04f0e79

4 files changed

Lines changed: 43 additions & 23 deletions

File tree

requirements.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
opengeode-core==15.31.1
1+
opengeode-core==15.31.5
22
opengeode-io==7.4.8
3-
opengeode-inspector==6.8.16
4-
opengeode-geosciences==9.5.8
5-
opengeode-geosciencesio==5.8.9
6-
geode-common==33.18.0
3+
opengeode-inspector==6.8.17
4+
opengeode-geosciences==9.5.9
5+
opengeode-geosciencesio==5.8.10
6+
geode-common==33.19.0
77
geode-viewables==3.3.4
88
flask[async]==3.1.2
99
flask-cors==6.0.1

requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ flask[async]>=3
1616
# flask-cors
1717
flask-cors==6.0.1
1818
# via -r requirements.in
19-
geode-common==33.18.0
19+
geode-common==33.19.0
2020
# via
2121
# -r requirements.in
2222
# geode-viewables
@@ -31,7 +31,7 @@ markupsafe>=3
3131
# flask
3232
# jinja2
3333
# werkzeug
34-
opengeode-core==15.31.1
34+
opengeode-core==15.31.5
3535
# via
3636
# -r requirements.in
3737
# geode-common
@@ -40,14 +40,14 @@ opengeode-core==15.31.1
4040
# opengeode-geosciencesio
4141
# opengeode-inspector
4242
# opengeode-io
43-
opengeode-geosciences==9.5.8
43+
opengeode-geosciences==9.5.9
4444
# via
4545
# -r requirements.in
4646
# geode-viewables
4747
# opengeode-geosciencesio
48-
opengeode-geosciencesio==5.8.9
48+
opengeode-geosciencesio==5.8.10
4949
# via -r requirements.in
50-
opengeode-inspector==6.8.16
50+
opengeode-inspector==6.8.17
5151
# via -r requirements.in
5252
opengeode-io==7.4.8
5353
# via

src/opengeodeweb_back/routes/blueprint_routes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ def ping() -> flask.Response:
402402
@routes.route(schemas_dict["kill"]["route"], methods=schemas_dict["kill"]["methods"])
403403
def kill() -> flask.Response:
404404
print("Manual server kill, shutting down...", flush=True)
405+
utils_functions.teardown_request(flask.current_app)
405406
os._exit(0)
406407
return flask.make_response({"message": "Flask server is dead"}, 200)
407408

src/opengeodeweb_back/test_utils.py

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,40 @@
1010

1111

1212
def test_route_wrong_params(
13-
client: FlaskClient, route: str, get_full_data: Callable[[], JsonData]
13+
client: FlaskClient,
14+
route: str,
15+
get_full_data: Callable[[], JsonData],
16+
path: list[str | int] | None = None,
1417
) -> None:
15-
for key, value in get_full_data().items():
18+
if path is None:
19+
path = []
20+
21+
def get_json() -> tuple[JsonData, Any]:
1622
json = get_full_data()
17-
json.pop(key)
23+
target: Any = json
24+
for sub_path in path:
25+
target = target[sub_path]
26+
return json, target
27+
28+
data = get_json()[1]
29+
if isinstance(data, dict):
30+
for key, value in data.items():
31+
json, target = get_json()
32+
target.pop(key)
33+
response = client.post(route, json=json)
34+
if response.status_code == 400:
35+
error_description: str = response.get_json()["description"]
36+
assert "must contain" in error_description
37+
assert f"'{key}'" in error_description
38+
if isinstance(value, (dict, list)):
39+
test_route_wrong_params(client, route, get_full_data, path + [key])
40+
41+
json, target = get_json()
42+
target["dumb_key"] = "dumb_value"
1843
response = client.post(route, json=json)
1944
assert response.status_code == 400
2045
error_description = response.get_json()["description"]
21-
assert "data must contain" in error_description
22-
assert f"'{key}'" in error_description
23-
24-
json = get_full_data()
25-
json["dumb_key"] = "dumb_value"
26-
response = client.post(route, json=json)
27-
assert response.status_code == 400
28-
error_description = response.get_json()["description"]
29-
assert "data must not contain" in error_description
30-
assert "'dumb_key'" in error_description
46+
assert "must not contain" in error_description
47+
assert "'dumb_key'" in error_description
48+
elif isinstance(data, list) and data:
49+
test_route_wrong_params(client, route, get_full_data, path + [0])

0 commit comments

Comments
 (0)