Skip to content

Commit 67feb2d

Browse files
committed
test
1 parent 808f805 commit 67feb2d

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/opengeodeweb_back/routes/blueprint_routes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,11 @@ def geode_objects_and_output_extensions():
248248
def save_viewable_file():
249249
utils_functions.validate_request(flask.request, save_viewable_file_json)
250250
file_path = geode_functions.upload_file_path(flask.request.json["filename"])
251-
file_path = geode_functions.upload_file_path(flask.request.json["filename"])
252251
return flask.make_response(
253252
utils_functions.generate_native_viewable_and_light_viewable_from_file(
254-
input_filename=file_path,
253+
flask.request.json["input_geode_object"],
254+
"upload",
255+
flask.request.json["filename"]
255256
),
256257
200,
257258
)

src/opengeodeweb_back/utils_functions.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,10 @@ def generate_native_viewable_and_light_viewable_from_object(geode_object, data):
148148
return generate_native_viewable_and_light_viewable(geode_object, data)
149149

150150

151-
def generate_native_viewable_and_light_viewable_from_file(geode_object, data_id, input_filename):
152-
file_absolute_path = geode_functions.data_file_path(data_id, input_filename)
153-
data = geode_functions.load(geode_object, file_absolute_path)
151+
def generate_native_viewable_and_light_viewable_from_file(geode_object, input_filename):
152+
data = geode_functions.load(geode_object, input_filename)
154153
return generate_native_viewable_and_light_viewable(
155-
geode_object, data, file_absolute_path
154+
geode_object, data, input_filename
156155
)
157156

158157

tests/test_utils_functions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,12 @@ def test_generate_native_viewable_and_light_viewable_from_file(client):
100100
app = client.application
101101
with app.app_context():
102102
geode_object = "BRep"
103-
data_id = "test_id"
103+
data_id = "test_data"
104104
input_filename = "test.og_brep"
105+
106+
# Copier le fichier de test dans le dossier data_id
107+
import shutil
108+
import os
105109
data_path = geode_functions.data_file_path(data_id, input_filename)
106110
os.makedirs(os.path.dirname(data_path), exist_ok=True)
107111
shutil.copy("./tests/data/test.og_brep", data_path)

0 commit comments

Comments
 (0)