Skip to content

Commit 4d9f503

Browse files
committed
test
1 parent a3c4016 commit 4d9f503

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

tests/test_models_routes.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
def test_model_mesh_components(client, test_id):
99
route = "/models/vtm_component_indices"
1010

11-
data_path = geode_functions.data_file_path({"id": test_id}, "viewable.vtm")
12-
os.makedirs(os.path.dirname(data_path), exist_ok=True)
13-
shutil.copy("./tests/data/cube.vtm", data_path)
11+
with client.application.app_context():
12+
data_path = geode_functions.data_file_path({"id": test_id}, "viewable.vtm")
13+
os.makedirs(os.path.dirname(data_path), exist_ok=True)
14+
shutil.copy("./tests/data/cube.vtm", data_path)
1415

1516
response = client.post(route, json={"id": test_id})
1617
assert response.status_code == 200
@@ -30,9 +31,10 @@ def test_extract_brep_uuids(client, test_id):
3031
brep_filename = "cube.og_brep"
3132
json_data = {"id": test_id, "geode_object": "BRep", "filename": brep_filename}
3233

33-
data_path = geode_functions.data_file_path(json_data, brep_filename)
34-
os.makedirs(os.path.dirname(data_path), exist_ok=True)
35-
shutil.copy(f"./tests/data/{brep_filename}", data_path)
34+
with client.application.app_context():
35+
data_path = geode_functions.data_file_path(json_data, brep_filename)
36+
os.makedirs(os.path.dirname(data_path), exist_ok=True)
37+
shutil.copy(f"./tests/data/{brep_filename}", data_path)
3638

3739
response = client.post(route, json=json_data)
3840
assert response.status_code == 200

tests/test_routes.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Standard library imports
22
import os
3+
import shutil
34

45
# Third party imports
56
from werkzeug.datastructures import FileStorage
@@ -171,6 +172,13 @@ def get_full_data():
171172

172173

173174
def test_texture_coordinates(client, test_id):
175+
with client.application.app_context():
176+
data_path = geode_functions.data_file_path(
177+
{"id": test_id, "filename": "hat.vtp"}, "hat.vtp"
178+
)
179+
os.makedirs(os.path.dirname(data_path), exist_ok=True)
180+
shutil.copy("./tests/vertex_attribute.vtp", data_path)
181+
174182
response = client.post(
175183
"/texture_coordinates",
176184
json={

0 commit comments

Comments
 (0)