Skip to content

Commit 51d4427

Browse files
Apply prepare changes
1 parent cf2360d commit 51d4427

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

src/opengeodeweb_back/geode_objects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# Local application imports
1212

13+
1314
def geode_objects_dict():
1415
return {
1516
"BRep": {

src/opengeodeweb_back/routes/blueprint_routes.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ def create_point():
310310
) as file:
311311
vertex_attribute_names_json = json.load(file)
312312

313+
313314
@routes.route(
314315
vertex_attribute_names_json["route"],
315316
methods=vertex_attribute_names_json["methods"],
@@ -318,8 +319,12 @@ def vertex_attribute_names():
318319

319320
UPLOAD_FOLDER = flask.current_app.config["UPLOAD_FOLDER"]
320321
utils_functions.validate_request(flask.request, vertex_attribute_names_json)
321-
file_absolute_path = os.path.join(UPLOAD_FOLDER, werkzeug.utils.secure_filename(flask.request.json["filename"]))
322-
data = geode_functions.load(flask.request.json["input_geode_object"], file_absolute_path)
322+
file_absolute_path = os.path.join(
323+
UPLOAD_FOLDER, werkzeug.utils.secure_filename(flask.request.json["filename"])
324+
)
325+
data = geode_functions.load(
326+
flask.request.json["input_geode_object"], file_absolute_path
327+
)
323328
vertex_attribute_names = data.vertex_attribute_manager().attribute_names()
324329
print(f"vertex_attribute_names: {vertex_attribute_names}", flush=True)
325330
return flask.make_response(

src/opengeodeweb_back/test_utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ def test_route_wrong_params(client, route, get_full_data):
1313
assert response.status_code == 400
1414
error_description = response.json["description"]
1515
assert error_description == f"Validation error: '{key}' is a required property"
16-
16+
1717
json = get_full_data()
1818
json["dumb_key"] = "dumb_value"
1919
response = client.post(route, json=json)
2020
assert response.status_code == 400
2121
error_description = response.json["description"]
22-
assert error_description == "Validation error: Additional properties are not allowed ('dumb_key' was unexpected)"
23-
22+
assert (
23+
error_description
24+
== "Validation error: Additional properties are not allowed ('dumb_key' was unexpected)"
25+
)

tests/test_routes.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def get_full_data():
4444
# Test all params
4545
test_utils.test_route_wrong_params(client, route, get_full_data)
4646

47+
4748
def test_upload_file(client):
4849
response = client.put(
4950
f"/upload_file",
@@ -63,7 +64,7 @@ def get_full_data():
6364
}
6465

6566
json = get_full_data()
66-
response = client.post(route,json=json)
67+
response = client.post(route, json=json)
6768
assert response.status_code == 200
6869
has_missing_files = response.json["has_missing_files"]
6970
mandatory_files = response.json["mandatory_files"]
@@ -75,6 +76,7 @@ def get_full_data():
7576
# Test all params
7677
test_utils.test_route_wrong_params(client, route, get_full_data)
7778

79+
7880
def test_geographic_coordinate_systems(client):
7981
route = f"/geographic_coordinate_systems"
8082
get_full_data = lambda: {"input_geode_object": "BRep"}
@@ -89,8 +91,9 @@ def test_geographic_coordinate_systems(client):
8991
# Test all params
9092
test_utils.test_route_wrong_params(client, route, get_full_data)
9193

94+
9295
def test_inspect_file(client):
93-
route = f"/inspect_file"
96+
route = f"/inspect_file"
9497

9598
def get_full_data():
9699
return {
@@ -109,6 +112,7 @@ def get_full_data():
109112
# Test all params
110113
test_utils.test_route_wrong_params(client, route, get_full_data)
111114

115+
112116
def test_geode_objects_and_output_extensions(client):
113117
route = "/geode_objects_and_output_extensions"
114118

@@ -159,6 +163,7 @@ def get_full_data():
159163
# Test all params
160164
test_utils.test_route_wrong_params(client, route, get_full_data)
161165

166+
162167
def test_vertex_attribute_names(client):
163168
response = client.put(
164169
f"/upload_file",
@@ -197,5 +202,5 @@ def test_create_point(client):
197202
id = response.json["id"]
198203
assert type(id) is str
199204

200-
# Test all params
205+
# Test all params
201206
test_utils.test_route_wrong_params(client, route, get_full_data)

0 commit comments

Comments
 (0)