Skip to content

Commit 4f43fc7

Browse files
committed
data_id added to save_viewable route
1 parent 2075754 commit 4f43fc7

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

src/opengeodeweb_back/routes/blueprint_routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ def save_viewable_file():
249249
utils_functions.validate_request(flask.request, save_viewable_file_json)
250250
return flask.make_response(
251251
utils_functions.generate_native_viewable_and_light_viewable_from_file(
252-
input_geode_object=flask.request.json["input_geode_object"],
252+
geode_object=flask.request.json["input_geode_object"],
253+
input_filename=flask.request.json["filename"],
253254
data_id=flask.request.json["data_id"],
254-
filename=flask.request.json["filename"],
255255
),
256256
200,
257257
)

src/opengeodeweb_back/routes/schemas/save_viewable_file.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
},
2121
"required": [
2222
"input_geode_object",
23-
"filename"
23+
"filename",
24+
"data_id"
2425
],
2526
"additionalProperties": false
2627
}

tests/test_routes.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,15 @@ def get_full_data():
138138
test_utils.test_route_wrong_params(client, route, get_full_data)
139139

140140

141-
def test_save_viewable_file(client):
142-
test_upload_file(client, filename="test.og_brep")
141+
def test_save_viewable_file(client, test_id):
142+
test_upload_file(client, filename="corbi.og_brep")
143143
route = f"/save_viewable_file"
144144

145145
def get_full_data():
146146
return {
147147
"input_geode_object": "BRep",
148-
"filename": "test.og_brep",
148+
"filename": "corbi.og_brep",
149+
"data_id": test_id,
149150
}
150151

151152
# Normal test with filename 'corbi.og_brep'

tests/test_utils_functions.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,15 @@ def test_generate_native_viewable_and_light_viewable_from_object(client):
9696
assert result["input_files"] == []
9797

9898

99-
def test_generate_native_viewable_and_light_viewable_from_file(client):
99+
def test_generate_native_viewable_and_light_viewable_from_file(client, test_id):
100100
app = client.application
101101
with app.app_context():
102102
geode_object = "BRep"
103-
input_filename = "./tests/data/test.og_brep"
103+
input_filename = "test.og_brep"
104+
data_id = test_id
104105

105106
result = utils_functions.generate_native_viewable_and_light_viewable_from_file(
106-
geode_object, input_filename
107+
geode_object, input_filename, data_id
107108
)
108109

109110
assert isinstance(result, dict)

0 commit comments

Comments
 (0)