99import shutil
1010import uuid
1111import zipfile
12- import io
1312from pathlib import Path
1413
1514# Local application imports
1615from opengeodeweb_microservice .database .data import Data
17- from opengeodeweb_microservice .database .connection import get_session
18- from opengeodeweb_back import geode_functions , utils_functions
16+ from opengeodeweb_back import utils_functions
1917from opengeodeweb_back .geode_objects .geode_brep import GeodeBRep
2018
2119base_dir = os .path .abspath (os .path .dirname (__file__ ))
@@ -123,12 +121,12 @@ def test_save_all_viewables_and_return_info(client: FlaskClient) -> None:
123121 )
124122
125123 assert isinstance (result , dict )
126- native_filename = result ["native_filename " ]
127- assert isinstance (native_filename , str )
128- assert native_filename .startswith ("native." )
129- viewable_filename = result ["viewable_filename " ]
130- assert isinstance (viewable_filename , str )
131- assert viewable_filename .endswith (".vtm" )
124+ native_file = result ["native_file " ]
125+ assert isinstance (native_file , str )
126+ assert native_file .startswith ("native." )
127+ viewable_file = result ["viewable_file " ]
128+ assert isinstance (viewable_file , str )
129+ assert viewable_file .endswith (".vtm" )
132130 assert isinstance (result ["id" ], str )
133131 assert len (result ["id" ]) == 32
134132 assert re .match (r"[0-9a-f]{32}" , result ["id" ])
@@ -139,8 +137,8 @@ def test_save_all_viewables_and_return_info(client: FlaskClient) -> None:
139137
140138 db_entry = Data .get (result ["id" ])
141139 assert db_entry is not None
142- assert db_entry .native_filename == result ["native_filename " ]
143- assert db_entry .viewable_filename == result ["viewable_filename " ]
140+ assert db_entry .native_file == result ["native_file " ]
141+ assert db_entry .viewable_file == result ["viewable_file " ]
144142 assert db_entry .geode_object == geode_object .geode_object_type ()
145143 assert db_entry .input_file == input_file
146144 assert db_entry .additional_files == additional_files
@@ -169,7 +167,7 @@ def test_save_all_viewables_commits_to_db(client: FlaskClient) -> None:
169167 assert isinstance (data_id , str )
170168 db_entry_before = Data .get (data_id )
171169 assert db_entry_before is not None
172- assert db_entry_before .native_filename == result ["native_filename " ]
170+ assert db_entry_before .native_file == result ["native_file " ]
173171
174172
175173def test_generate_native_viewable_and_light_viewable_from_object (
@@ -186,10 +184,10 @@ def test_generate_native_viewable_and_light_viewable_from_object(
186184 )
187185
188186 assert isinstance (result , dict )
189- assert isinstance (result ["native_filename " ], str )
190- assert result ["native_filename " ].startswith ("native." )
191- assert isinstance (result ["viewable_filename " ], str )
192- assert result ["viewable_filename " ].endswith (".vtm" )
187+ assert isinstance (result ["native_file " ], str )
188+ assert result ["native_file " ].startswith ("native." )
189+ assert isinstance (result ["viewable_file " ], str )
190+ assert result ["viewable_file " ].endswith (".vtm" )
193191 assert isinstance (result ["id" ], str )
194192 assert re .match (r"[0-9a-f]{32}" , result ["id" ])
195193 assert isinstance (result ["viewer_type" ], str )
@@ -207,10 +205,10 @@ def test_generate_native_viewable_and_light_viewable_from_file(
207205 )
208206
209207 assert isinstance (result , dict )
210- assert isinstance (result ["native_filename " ], str )
211- assert result ["native_filename " ].startswith ("native." )
212- assert isinstance (result ["viewable_filename " ], str )
213- assert result ["viewable_filename " ].endswith (".vtm" )
208+ assert isinstance (result ["native_file " ], str )
209+ assert result ["native_file " ].startswith ("native." )
210+ assert isinstance (result ["viewable_file " ], str )
211+ assert result ["viewable_file " ].endswith (".vtm" )
214212 assert isinstance (result ["id" ], str )
215213 assert re .match (r"[0-9a-f]{32}" , result ["id" ])
216214 assert isinstance (result ["viewer_type" ], str )
0 commit comments