Skip to content

Commit 12ce6ac

Browse files
committed
test
1 parent f23a73e commit 12ce6ac

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/opengeodeweb_back/routes/blueprint_routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,11 @@ def geode_objects_and_output_extensions():
247247
)
248248
def save_viewable_file():
249249
utils_functions.validate_request(flask.request, save_viewable_file_json)
250-
file_path = geode_functions.upload_file_path(flask.request.json["filename"])
251250
return flask.make_response(
252251
utils_functions.generate_native_viewable_and_light_viewable_from_file(
253252
flask.request.json["input_geode_object"],
254-
input_filename=file_path,
253+
flask.request.json["data_id"], # Nouveau paramètre
254+
flask.request.json["filename"],
255255
),
256256
200,
257257
)

tests/test_utils_functions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,14 @@ 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-
input_filename = "./tests/data/test.og_brep"
103+
data_id = "test_id"
104+
input_filename = "test.og_brep"
105+
data_path = geode_functions.data_file_path(data_id, input_filename)
106+
os.makedirs(os.path.dirname(data_path), exist_ok=True)
107+
shutil.copy("./tests/data/test.og_brep", data_path)
104108

105109
result = utils_functions.generate_native_viewable_and_light_viewable_from_file(
106-
geode_object, input_filename
110+
geode_object, data_id, input_filename
107111
)
108112

109113
assert isinstance(result, dict)

0 commit comments

Comments
 (0)