88# Local application imports
99from opengeodeweb_microservice .database .data import Data
1010from opengeodeweb_microservice .database .connection import get_session
11- from src . opengeodeweb_back import geode_functions , test_utils
11+ from opengeodeweb_back import geode_functions , test_utils
1212
1313
1414def test_allowed_files (client ):
15- route = f"/allowed_files"
15+ route = f"/opengeodeweb_back/ allowed_files"
1616 get_full_data = lambda : {"supported_feature" : "None" }
1717 json = get_full_data ()
1818 response = client .post (route , json = json )
@@ -27,7 +27,7 @@ def test_allowed_files(client):
2727
2828
2929def test_allowed_objects (client ):
30- route = f"/allowed_objects"
30+ route = f"/opengeodeweb_back/ allowed_objects"
3131
3232 def get_full_data ():
3333 return {
@@ -49,14 +49,14 @@ def get_full_data():
4949
5050def test_upload_file (client , filename = "test.og_brep" ):
5151 response = client .put (
52- f"/upload_file" ,
53- data = {"file" : FileStorage (open (f"./tests/data/{ filename } " , "rb" ))},
52+ f"/opengeodeweb_back/ upload_file" ,
53+ data = {"file" : FileStorage (open (f"./src/ tests/data/{ filename } " , "rb" ))},
5454 )
5555 assert response .status_code == 201
5656
5757
5858def test_missing_files (client ):
59- route = f"/missing_files"
59+ route = f"/opengeodeweb_back/ missing_files"
6060
6161 def get_full_data ():
6262 return {
@@ -79,7 +79,7 @@ def get_full_data():
7979
8080
8181def test_geographic_coordinate_systems (client ):
82- route = f"/geographic_coordinate_systems"
82+ route = f"/opengeodeweb_back/ geographic_coordinate_systems"
8383 get_full_data = lambda : {"input_geode_object" : "BRep" }
8484 # Normal test with geode_object 'BRep'
8585 response = client .post (route , json = get_full_data ())
@@ -94,7 +94,7 @@ def test_geographic_coordinate_systems(client):
9494
9595
9696def test_inspect_file (client ):
97- route = f"/inspect_file"
97+ route = f"/opengeodeweb_back/ inspect_file"
9898
9999 def get_full_data ():
100100 return {
@@ -115,7 +115,7 @@ def get_full_data():
115115
116116
117117def test_geode_objects_and_output_extensions (client ):
118- route = "/geode_objects_and_output_extensions"
118+ route = "/opengeodeweb_back/ geode_objects_and_output_extensions"
119119
120120 def get_full_data ():
121121 return {
@@ -142,7 +142,7 @@ def get_full_data():
142142
143143def test_save_viewable_file (client ):
144144 test_upload_file (client , filename = "corbi.og_brep" )
145- route = f"/save_viewable_file"
145+ route = f"/opengeodeweb_back/ save_viewable_file"
146146
147147 def get_full_data ():
148148 return {
@@ -179,9 +179,11 @@ def test_texture_coordinates(client, test_id):
179179
180180 data_path = geode_functions .data_file_path (data .id , data .native_file_name )
181181 os .makedirs (os .path .dirname (data_path ), exist_ok = True )
182- shutil .copy ("./tests/data/hat.vtp" , data_path )
182+ shutil .copy ("./src/ tests/data/hat.vtp" , data_path )
183183 assert os .path .exists (data_path ), f"File not found at { data_path } "
184- response = client .post ("/texture_coordinates" , json = {"id" : data .id })
184+ response = client .post (
185+ "/opengeodeweb_back/texture_coordinates" , json = {"id" : data .id }
186+ )
185187 assert response .status_code == 200
186188 texture_coordinates = response .json ["texture_coordinates" ]
187189 assert type (texture_coordinates ) is list
@@ -190,7 +192,7 @@ def test_texture_coordinates(client, test_id):
190192
191193
192194def test_vertex_attribute_names (client , test_id ):
193- route = f"/vertex_attribute_names"
195+ route = f"/opengeodeweb_back/ vertex_attribute_names"
194196
195197 with client .application .app_context ():
196198 data = Data .create (geode_object = "PolygonalSurface3D" , input_file = "test.vtp" )
@@ -201,7 +203,7 @@ def test_vertex_attribute_names(client, test_id):
201203
202204 data_path = geode_functions .data_file_path (data .id , data .native_file_name )
203205 os .makedirs (os .path .dirname (data_path ), exist_ok = True )
204- shutil .copy ("./tests/data/test.vtp" , data_path )
206+ shutil .copy ("./src/ tests/data/test.vtp" , data_path )
205207 assert os .path .exists (data_path ), f"File not found at { data_path } "
206208 response = client .post (route , json = {"id" : data .id })
207209 assert response .status_code == 200
@@ -212,7 +214,7 @@ def test_vertex_attribute_names(client, test_id):
212214
213215
214216def test_polygon_attribute_names (client , test_id ):
215- route = f"/polygon_attribute_names"
217+ route = f"/opengeodeweb_back/ polygon_attribute_names"
216218
217219 with client .application .app_context ():
218220 data = Data .create (geode_object = "PolygonalSurface3D" , input_file = "test.vtp" )
@@ -223,7 +225,7 @@ def test_polygon_attribute_names(client, test_id):
223225
224226 data_path = geode_functions .data_file_path (data .id , data .native_file_name )
225227 os .makedirs (os .path .dirname (data_path ), exist_ok = True )
226- shutil .copy ("./tests/data/test.vtp" , data_path )
228+ shutil .copy ("./src/ tests/data/test.vtp" , data_path )
227229 assert os .path .exists (data_path ), f"File not found at { data_path } "
228230 response = client .post (route , json = {"id" : data .id })
229231 assert response .status_code == 200
@@ -234,7 +236,7 @@ def test_polygon_attribute_names(client, test_id):
234236
235237
236238def test_polyhedron_attribute_names (client , test_id ):
237- route = f"/polyhedron_attribute_names"
239+ route = f"/opengeodeweb_back/ polyhedron_attribute_names"
238240
239241 with client .application .app_context ():
240242 data = Data .create (geode_object = "PolyhedralSolid3D" , input_file = "test.vtu" )
@@ -245,7 +247,7 @@ def test_polyhedron_attribute_names(client, test_id):
245247
246248 data_path = geode_functions .data_file_path (data .id , data .native_file_name )
247249 os .makedirs (os .path .dirname (data_path ), exist_ok = True )
248- shutil .copy ("./tests/data/test.vtu" , data_path )
250+ shutil .copy ("./src/ tests/data/test.vtu" , data_path )
249251 assert os .path .exists (data_path ), f"File not found at { data_path } "
250252 response = client .post (route , json = {"id" : data .id })
251253 print (response .json )
@@ -257,7 +259,7 @@ def test_polyhedron_attribute_names(client, test_id):
257259
258260
259261def test_create_point (client ):
260- route = f"/create_point"
262+ route = f"/opengeodeweb_back/ create_point"
261263 get_full_data = lambda : {"title" : "test_point" , "x" : 1 , "y" : 2 , "z" : 3 }
262264
263265 # Normal test with all keys
0 commit comments