Esempio n. 1
0
 def test_filebowser_foldercreation(self):
     fb = FileBrowser(self.window, initialdir="/", foldercreation=True)
     self.window.update()
     self.assertTrue(fb.b_new_folder.winfo_ismapped())
     self.assertTrue('disabled' in fb.b_new_folder.state())
     fb.display_folder(os.path.expanduser('~'))
     self.window.update()
     self.assertTrue(fb.b_new_folder.winfo_ismapped())
     self.assertFalse('disabled' in fb.b_new_folder.state())
     fb.left_tree.selection_clear()
     fb.left_tree.selection_set('recent')
     self.window.update()
     self.assertFalse(fb.b_new_folder.winfo_ismapped())
Esempio n. 2
0
 def test_filebowser_foldercreation(self):
     initdir = os.path.abspath('/')
     fb = FileBrowser(self.window, initialdir=initdir,
                      foldercreation=True)
     self.window.update()
     self.assertTrue(fb.b_new_folder.winfo_ismapped())
     self.assertIs('disabled' not in fb.b_new_folder.state(), os.access(initdir, os.W_OK))
     fb.display_folder(os.path.expanduser('~'))
     self.window.update()
     self.assertTrue(fb.b_new_folder.winfo_ismapped())
     self.assertFalse('disabled' in fb.b_new_folder.state())
     fb.left_tree.selection_clear()
     fb.left_tree.selection_set('recent')
     self.window.update()
     self.assertFalse(fb.b_new_folder.winfo_ismapped())