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