1"Test help, coverage 94%." 2 3from idlelib import help 4import unittest 5from test.support import requires 6requires('gui') 7from os.path import abspath, dirname, join 8from tkinter import Tk 9 10 11class IdleDocTest(unittest.TestCase): 12 13 @classmethod 14 def setUpClass(cls): 15 "By itself, this tests that file parsed without exception." 16 cls.root = root = Tk() 17 root.withdraw() 18 cls.window = help.show_idlehelp(root) 19 20 @classmethod 21 def tearDownClass(cls): 22 del cls.window 23 cls.root.update_idletasks() 24 cls.root.destroy() 25 del cls.root 26 27 def test_1window(self): 28 self.assertIn('IDLE Doc', self.window.wm_title()) 29 30 def test_4text(self): 31 text = self.window.frame.text 32 self.assertEqual(text.get('1.0', '1.end'), ' IDLE ') 33 34 35if __name__ == '__main__': 36 unittest.main(verbosity=2) 37