@@ -183,16 +183,29 @@ def test_generate_native_viewable_and_light_viewable_from_object(
183183 )
184184 )
185185
186- assert isinstance (result , dict )
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" )
191- assert isinstance (result ["id" ], str )
192- assert re .match (r"[0-9a-f]{32}" , result ["id" ])
193- assert isinstance (result ["viewer_type" ], str )
194- assert isinstance (result ["binary_light_viewable" ], str )
195- assert result ["input_file" ] == ""
186+ assert isinstance (result , dict )
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" )
191+ assert isinstance (result ["id" ], str )
192+ assert re .match (r"[0-9a-f]{32}" , result ["id" ])
193+ assert isinstance (result ["viewer_type" ], str )
194+ assert isinstance (result ["binary_light_viewable" ], str )
195+ assert result ["binary_light_viewable" ].startswith ('<?xml version="1.0"?>' )
196+
197+ assert result ["input_file" ] == result ["native_file" ]
198+
199+ data = Data .get (result ["id" ])
200+ assert data is not None
201+ assert data .input_file == data .native_file
202+ assert data .light_viewable_file is not None
203+ assert data .light_viewable_file .endswith ('.vtp' )
204+
205+ data_path = os .path .join (app .config ["DATA_FOLDER_PATH" ], result ["id" ])
206+ assert os .path .exists (os .path .join (data_path , result ["native_file" ]))
207+ assert os .path .exists (os .path .join (data_path , result ["viewable_file" ]))
208+ assert os .path .exists (os .path .join (data_path , data .light_viewable_file ))
196209
197210
198211def test_generate_native_viewable_and_light_viewable_from_file (
0 commit comments