Skip to content

Commit 81f203f

Browse files
SpliiTgithub-actions[bot]
authored andcommitted
Apply prepare changes
1 parent 1a119ce commit 81f203f

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/opengeodeweb_back/routes/create/blueprint_create.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
routes = flask.Blueprint("create", __name__, url_prefix="/create")
1414
schemas_dict = get_schemas_dict(os.path.join(os.path.dirname(__file__), "schemas"))
1515

16+
1617
@routes.route(
1718
schemas_dict["create_point"]["route"],
1819
methods=schemas_dict["create_point"]["methods"],
@@ -37,8 +38,7 @@ def create_point() -> flask.Response:
3738

3839

3940
@routes.route(
40-
schemas_dict["create_aoi"]["route"],
41-
methods=schemas_dict["create_aoi"]["methods"]
41+
schemas_dict["create_aoi"]["route"], methods=schemas_dict["create_aoi"]["methods"]
4242
)
4343
def create_aoi() -> flask.Response:
4444
"""Endpoint to create an Area of Interest (AOI) as an EdgedCurve3D."""
@@ -69,8 +69,7 @@ def create_aoi() -> flask.Response:
6969

7070

7171
@routes.route(
72-
schemas_dict["create_voi"]["route"],
73-
methods=schemas_dict["create_voi"]["methods"]
72+
schemas_dict["create_voi"]["route"], methods=schemas_dict["create_voi"]["methods"]
7473
)
7574
def create_voi() -> flask.Response:
7675
"""Endpoint to create a Volume of Interest (VOI) as an EdgedCurve3D (a bounding box/prism)."""

tests/test_create_routes.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,12 @@ def test_create_aoi(client: FlaskClient, aoi_data: Dict[str, Any]) -> None:
9191
# Test with missing parameters
9292
test_utils.test_route_wrong_params(client, route, lambda: aoi_data.copy()) # type: ignore
9393

94-
def test_create_voi(client: FlaskClient, aoi_data: Dict[str, Any], voi_data: Dict[str, Any]) -> None:
94+
95+
def test_create_voi(
96+
client: FlaskClient, aoi_data: Dict[str, Any], voi_data: Dict[str, Any]
97+
) -> None:
9598
"""Test the creation of a VOI with valid data (including optional id)."""
96-
aoi_route = "/opengeodeweb_back/create/create_aoi"
99+
aoi_route = "/opengeodeweb_back/create/create_aoi"
97100
aoi_response = client.post(aoi_route, json=aoi_data)
98101
assert aoi_response.status_code == 200
99102
aoi_id = aoi_response.json["id"]
@@ -111,6 +114,7 @@ def test_create_voi(client: FlaskClient, aoi_data: Dict[str, Any], voi_data: Dic
111114
assert response_data["object_type"] == "mesh"
112115
assert response_data["geode_object"] == "EdgedCurve3D"
113116

117+
114118
def test_create_point_with_invalid_data(client: FlaskClient) -> None:
115119
"""Test the point creation endpoint with invalid data."""
116120
route: str = "/opengeodeweb_back/create/create_point"
@@ -167,7 +171,7 @@ def test_create_voi_with_invalid_data(
167171
assert aoi_response.status_code == 200
168172
aoi_id = aoi_response.json["id"]
169173

170-
route = "/opengeodeweb_back/create/create_aoi"
174+
route = "/opengeodeweb_back/create/create_aoi"
171175

172176
invalid_data = {**voi_data, "aoi_id": aoi_id, "z_min": "not_a_number"}
173177
response = client.post(route, json=invalid_data)
@@ -179,4 +183,4 @@ def test_create_voi_with_invalid_data(
179183

180184
invalid_data = {**voi_data, "aoi_id": 12345}
181185
response = client.post(route, json=invalid_data)
182-
assert response.status_code == 400
186+
assert response.status_code == 400

0 commit comments

Comments
 (0)