Skip to content

Commit 7061126

Browse files
MaxNumeriquegithub-actions[bot]
authored andcommitted
Apply prepare changes
1 parent 7451bf7 commit 7061126

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

src/opengeodeweb_back/routes/models/blueprint_models.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
def uuid_to_flat_index():
2020
utils_functions.validate_request(flask.request, vtm_component_indices_json)
2121
vtm_file_path = os.path.join(
22-
flask.current_app.config["DATA_FOLDER_PATH"], flask.request.json["id"] , "viewable.vtm"
22+
flask.current_app.config["DATA_FOLDER_PATH"],
23+
flask.request.json["id"],
24+
"viewable.vtm",
2325
)
2426
tree = ET.parse(vtm_file_path)
2527
root = tree.find("vtkMultiBlockDataSet")
@@ -59,7 +61,9 @@ def extract_model_uuids(geode_object, file_path):
5961
def extract_uuids_endpoint():
6062
utils_functions.validate_request(flask.request, mesh_components_json)
6163
file_path = os.path.join(
62-
flask.current_app.config["DATA_FOLDER_PATH"], flask.request.json["id"], flask.request.json["filename"]
64+
flask.current_app.config["DATA_FOLDER_PATH"],
65+
flask.request.json["id"],
66+
flask.request.json["filename"],
6367
)
6468
if not os.path.exists(file_path):
6569
return flask.make_response({"error": "File not found"}, 404)

src/opengeodeweb_back/utils_functions.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ def handle_exception(e):
143143
return response
144144

145145

146-
def generate_native_viewable_and_light_viewable(
147-
geode_object, data
148-
):
146+
def generate_native_viewable_and_light_viewable(geode_object, data):
149147
generated_id = str(uuid.uuid4()).replace("-", "")
150148
DATA_FOLDER_PATH = flask.current_app.config["DATA_FOLDER_PATH"]
151149
data_path = os.path.join(DATA_FOLDER_PATH, generated_id)
@@ -159,7 +157,7 @@ def generate_native_viewable_and_light_viewable(
159157
"native." + data.native_extension(),
160158
)
161159
saved_viewable_file_path = geode_functions.save_viewable(
162-
geode_object, data, data_path, "viewable"
160+
geode_object, data, data_path, "viewable"
163161
)
164162
viewable_file_name = os.path.basename(saved_viewable_file_path)
165163
saved_light_viewable_file_path = geode_functions.save_light_viewable(
@@ -172,7 +170,7 @@ def generate_native_viewable_and_light_viewable(
172170
return {
173171
"name": name,
174172
"native_file_name": os.path.basename(saved_native_file_path[0]),
175-
"viewable_file_name":viewable_file_name,
173+
"viewable_file_name": viewable_file_name,
176174
"id": generated_id,
177175
"object_type": object_type,
178176
"binary_light_viewable": str(binary_light_viewable, "utf-8"),

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def app_context():
3434
with app.app_context():
3535
yield
3636

37+
3738
@pytest.fixture
3839
def uuid_project_structure():
3940
uuid_project = uuid.uuid4().hex

tests/test_models_routes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import shutil
22
import os
33

4+
45
def test_model_mesh_components(client, uuid_project_structure):
56
route = "/models/vtm_component_indices"
67
uuid_data = uuid_project_structure["uuid_data"]
@@ -26,7 +27,6 @@ def test_model_mesh_components(client, uuid_project_structure):
2627
client.application.config["DATA_FOLDER_PATH"] = original_path
2728

2829

29-
3030
def test_extract_brep_uuids(client, uuid_project_structure):
3131
route = "/models/mesh_components"
3232
uuid_data = uuid_project_structure["uuid_data"]
@@ -41,7 +41,7 @@ def test_extract_brep_uuids(client, uuid_project_structure):
4141
json_data = {
4242
"filename": "cube.og_brep",
4343
"geode_object": "BRep",
44-
"id": uuid_data
44+
"id": uuid_data,
4545
}
4646
response = client.post(route, json=json_data)
4747
assert response.status_code == 200
@@ -55,4 +55,3 @@ def test_extract_brep_uuids(client, uuid_project_structure):
5555
assert all(isinstance(v, str) for v in value)
5656
finally:
5757
client.application.config["DATA_FOLDER_PATH"] = original_path
58-

0 commit comments

Comments
 (0)