1"Test help, coverage 87%." 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 HelpFrameTest(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 helpfile = join(dirname(dirname(abspath(__file__))), 'help.html') 19 cls.frame = help.HelpFrame(root, helpfile) 20 21 @classmethod 22 def tearDownClass(cls): 23 del cls.frame 24 cls.root.update_idletasks() 25 cls.root.destroy() 26 del cls.root 27 28 def test_line1(self): 29 text = self.frame.text 30 self.assertEqual(text.get('1.0', '1.end'), ' IDLE ') 31 32 33if __name__ == '__main__': 34 unittest.main(verbosity=2) 35