@@ -25,10 +25,9 @@ def test_filebrowser_opendir(self):
2525 fb .validate ()
2626 walk = os .walk (path )
2727 root , dirs , _ = walk .send (None )
28- # res = list(fb.right_tree.selection())
2928 res = list (fb .get_result ())
3029 res .sort ()
31- dirs = [os .path .join (root , d ) for d in dirs ]
30+ dirs = [os .path .realpath ( os . path . join (root , d ) ) for d in dirs ]
3231 dirs .sort ()
3332 self .assertEqual (res , dirs )
3433 # --- single selection
@@ -43,20 +42,24 @@ def test_filebrowser_opendir(self):
4342
4443 def test_filebrowser_openfile (self ):
4544 # --- multiple selection
46- fb = FileBrowser (self .window , initialdir = "." , initialfile = "test" , mode = "openfile" ,
45+ path = os .path .expanduser ('~' )
46+ fb = FileBrowser (self .window , initialdir = path , initialfile = "test" , mode = "openfile" ,
4747 multiple_selection = True , defaultext = ".png" ,
4848 title = "Test" , filetypes = [],
4949 okbuttontext = None , cancelbuttontext = "Cancel" ,
5050 foldercreation = False )
5151 self .window .update ()
52+ fb .right_tree .focus_force ()
53+ self .window .update ()
5254 fb .event_generate ('<Control-a>' )
5355 self .window .update ()
56+ self .window .update_idletasks ()
5457 fb .validate ()
55- walk = os .walk (os . path . abspath ( "." ) )
58+ walk = os .walk (path )
5659 root , _ , files = walk .send (None )
5760 res = list (fb .get_result ())
5861 res .sort ()
59- files = [os .path .join (root , d ) for d in files ]
62+ files = [os .path .realpath ( os . path . join (root , f )) for f in files ]
6063 files .sort ()
6164 self .assertEqual (res , files )
6265 # --- single selection
0 commit comments