1"Test filelist, coverage 19%." 2 3from idlelib import filelist 4import unittest 5from test.support import requires 6from tkinter import Tk 7 8class FileListTest(unittest.TestCase): 9 10 @classmethod 11 def setUpClass(cls): 12 requires('gui') 13 cls.root = Tk() 14 cls.root.withdraw() 15 16 @classmethod 17 def tearDownClass(cls): 18 cls.root.update_idletasks() 19 for id in cls.root.tk.call('after', 'info'): 20 cls.root.after_cancel(id) 21 cls.root.destroy() 22 del cls.root 23 24 def test_new_empty(self): 25 flist = filelist.FileList(self.root) 26 self.assertEqual(flist.root, self.root) 27 e = flist.new() 28 self.assertEqual(type(e), flist.EditorWindow) 29 e._close() 30 31 32if __name__ == '__main__': 33 unittest.main(verbosity=2) 34