File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Orange/widgets/data/tests Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,34 @@ def test_browse_for_missing(self):
296296 self .data_regions_options .as_dict (), cur .options ().as_dict ()
297297 )
298298
299+ def test_browse_for_missing_prefixed (self ):
300+ path = self .data_regions_path
301+ basedir = os .path .dirname (path )
302+ widget = self .create_widget (
303+ owcsvimport .OWCSVFileImport , stored_settings = {
304+ "__version__" : 3 ,
305+ "_session_items_v2" : [
306+ (PathItem .VarPath ("basedir" , "this file does not exist.csv" ).as_dict (),
307+ self .data_regions_options .as_dict ())]
308+ },
309+ env = {"basedir" : basedir }
310+ )
311+ widget .activate_recent (0 )
312+ dlg = widget .findChild (QFileDialog )
313+ assert dlg is not None
314+ # calling selectFile when using native (macOS) dialog does not have
315+ # an effect - at least not immediately;
316+ dlg .setOption (QFileDialog .DontUseNativeDialog )
317+ dlg .selectFile (path )
318+ dlg .accept ()
319+ cur = widget .current_item ()
320+ self .assertTrue (samepath (path , cur .path ()))
321+ self .assertEqual (
322+ cur .varPath (), PathItem .VarPath ("basedir" , "data-regions.tab" ))
323+ self .assertEqual (
324+ self .data_regions_options .as_dict (), cur .options ().as_dict ()
325+ )
326+
299327
300328class TestImportDialog (GuiTest ):
301329 @staticmethod
You can’t perform that action at this time.
0 commit comments