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 @@ -268,6 +268,34 @@ def test_browse_for_missing(self):
268268 self .data_regions_options .as_dict (), cur .options ().as_dict ()
269269 )
270270
271+ def test_browse_for_missing_prefixed (self ):
272+ path = self .data_regions_path
273+ basedir = os .path .dirname (path )
274+ widget = self .create_widget (
275+ owcsvimport .OWCSVFileImport , stored_settings = {
276+ "__version__" : 2 ,
277+ "_session_items_v2" : [
278+ (PathItem .VarPath ("basedir" , "this file does not exist.csv" ).as_dict (),
279+ self .data_regions_options .as_dict ())]
280+ },
281+ env = {"basedir" : basedir }
282+ )
283+ widget .activate_recent (0 )
284+ dlg = widget .findChild (QFileDialog )
285+ assert dlg is not None
286+ # calling selectFile when using native (macOS) dialog does not have
287+ # an effect - at least not immediately;
288+ dlg .setOption (QFileDialog .DontUseNativeDialog )
289+ dlg .selectFile (path )
290+ dlg .accept ()
291+ cur = widget .current_item ()
292+ self .assertTrue (samepath (path , cur .path ()))
293+ self .assertEqual (
294+ cur .varPath (), PathItem .VarPath ("basedir" , "data-regions.tab" ))
295+ self .assertEqual (
296+ self .data_regions_options .as_dict (), cur .options ().as_dict ()
297+ )
298+
271299
272300class TestImportDialog (GuiTest ):
273301 def test_dialog (self ):
You can’t perform that action at this time.
0 commit comments