Skip to content

Commit a734e8a

Browse files
committed
id added to texture_coordinates, vertex_attribute_names, polygon_attribute_names, polyhedron_attribute_names
test folder changed to match project_uuid path
1 parent 7451bf7 commit a734e8a

File tree

9 files changed

+40
-12
lines changed

9 files changed

+40
-12
lines changed

src/opengeodeweb_back/routes/blueprint_routes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def texture_coordinates():
290290
utils_functions.validate_request(flask.request, texture_coordinates_json)
291291
data = geode_functions.load(
292292
flask.request.json["input_geode_object"],
293-
os.path.join(DATA_FOLDER_PATH, flask.request.json["filename"]),
293+
os.path.join(DATA_FOLDER_PATH, flask.request.json["id"], flask.request.json["filename"]),
294294
)
295295
texture_coordinates = data.texture_manager().texture_names()
296296

@@ -312,7 +312,7 @@ def vertex_attribute_names():
312312
DATA_FOLDER_PATH = flask.current_app.config["DATA_FOLDER_PATH"]
313313
utils_functions.validate_request(flask.request, vertex_attribute_names_json)
314314
file_absolute_path = os.path.join(
315-
DATA_FOLDER_PATH, werkzeug.utils.secure_filename(flask.request.json["filename"])
315+
DATA_FOLDER_PATH, flask.request.json["id"], werkzeug.utils.secure_filename(flask.request.json["filename"])
316316
)
317317
data = geode_functions.load(
318318
flask.request.json["input_geode_object"], file_absolute_path
@@ -342,7 +342,7 @@ def polygon_attribute_names():
342342
DATA_FOLDER_PATH = flask.current_app.config["DATA_FOLDER_PATH"]
343343
utils_functions.validate_request(flask.request, polygon_attribute_names_json)
344344
file_absolute_path = os.path.join(
345-
DATA_FOLDER_PATH, werkzeug.utils.secure_filename(flask.request.json["filename"])
345+
DATA_FOLDER_PATH, flask.request.json["id"], werkzeug.utils.secure_filename(flask.request.json["filename"])
346346
)
347347
data = geode_functions.load(
348348
flask.request.json["input_geode_object"], file_absolute_path
@@ -372,7 +372,7 @@ def polyhedron_attribute_names():
372372
DATA_FOLDER_PATH = flask.current_app.config["DATA_FOLDER_PATH"]
373373
utils_functions.validate_request(flask.request, vertex_attribute_names_json)
374374
file_absolute_path = os.path.join(
375-
DATA_FOLDER_PATH, werkzeug.utils.secure_filename(flask.request.json["filename"])
375+
DATA_FOLDER_PATH, flask.request.json["id"], werkzeug.utils.secure_filename(flask.request.json["filename"])
376376
)
377377
data = geode_functions.load(
378378
flask.request.json["input_geode_object"], file_absolute_path

src/opengeodeweb_back/routes/models/schemas/mesh_components.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66
"type": "object",
77
"properties": {
88
"id": {
9-
"type": "string"
9+
"type": "string",
10+
"minLength": 1
1011
},
1112
"filename": {
12-
"type": "string"
13+
"type": "string",
14+
"minLength": 1
1315
},
1416
"geode_object": {
15-
"type": "string"
17+
"type": "string",
18+
"minLength": 1
1619
}
1720
},
1821
"required": [

src/opengeodeweb_back/routes/models/schemas/vtm_component_indices.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"type": "object",
77
"properties": {
88
"id": {
9-
"type": "string"
9+
"type": "string",
10+
"minLength": 1
1011
}
1112
},
1213
"required": [

src/opengeodeweb_back/routes/schemas/polygon_attribute_names.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@
1212
"filename": {
1313
"type": "string",
1414
"minLength": 1
15+
},
16+
"id": {
17+
"type": "string",
18+
"minLength": 1
1519
}
1620
},
1721
"required": [
1822
"input_geode_object",
19-
"filename"
23+
"filename",
24+
"id"
2025
],
2126
"additionalProperties": false
2227
}

src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@
1212
"filename": {
1313
"type": "string",
1414
"minLength": 1
15+
},
16+
"id": {
17+
"type": "string",
18+
"minLength": 1
1519
}
1620
},
1721
"required": [
1822
"input_geode_object",
19-
"filename"
23+
"filename",
24+
"id"
2025
],
2126
"additionalProperties": false
2227
}

src/opengeodeweb_back/routes/schemas/texture_coordinates.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@
1212
"filename": {
1313
"type": "string",
1414
"minLength": 1
15+
},
16+
"id": {
17+
"type": "string",
18+
"minLength": 1
1519
}
1620
},
1721
"required": [
1822
"input_geode_object",
23+
"id",
1924
"filename"
2025
],
2126
"additionalProperties": false

src/opengeodeweb_back/routes/schemas/vertex_attribute_names.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@
1212
"filename": {
1313
"type": "string",
1414
"minLength": 1
15+
},
16+
"id": {
17+
"type": "string",
18+
"minLength": 1
1519
}
1620
},
1721
"required": [
1822
"input_geode_object",
19-
"filename"
23+
"filename",
24+
"id"
2025
],
2126
"additionalProperties": false
2227
}

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@pytest.fixture(scope="session", autouse=True)
1515
def copy_data():
1616
shutil.rmtree("./data", ignore_errors=True)
17-
shutil.copytree("./tests/data", "./data", dirs_exist_ok=True)
17+
shutil.copytree("./tests/data/", "./data/1/", dirs_exist_ok=True)
1818

1919

2020
@pytest.fixture

tests/test_routes.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def test_texture_coordinates(client):
175175
"/texture_coordinates",
176176
json={
177177
"input_geode_object": "PolygonalSurface3D",
178+
"id": "1",
178179
"filename": "hat.vtp",
179180
},
180181
)
@@ -205,6 +206,7 @@ def test_vertex_attribute_names(client):
205206
def get_full_data():
206207
return {
207208
"input_geode_object": geode_object,
209+
"id": "1",
208210
"filename": f"test.{input_extension}",
209211
}
210212

@@ -241,6 +243,7 @@ def test_polygon_attribute_names(client):
241243
def get_full_data():
242244
return {
243245
"input_geode_object": geode_object,
246+
"id": "1",
244247
"filename": f"test.{input_extension}",
245248
}
246249

@@ -277,6 +280,7 @@ def test_polyhedron_attribute_names(client):
277280
def get_full_data():
278281
return {
279282
"input_geode_object": geode_object,
283+
"id": "1",
280284
"filename": f"test.{input_extension}",
281285
}
282286

0 commit comments

Comments
 (0)