Terry Jan Reedy | 01e3575 | 2016-06-10 18:19:21 -0400 | [diff] [blame] | 1 | '''Test idlelib.help. |
| 2 | |
| 3 | Coverage: 87% |
| 4 | ''' |
| 5 | from idlelib import help |
| 6 | from test.support import requires |
| 7 | requires('gui') |
| 8 | from os.path import abspath, dirname, join |
| 9 | from tkinter import Tk |
| 10 | import unittest |
| 11 | |
| 12 | class 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() |
Terry Jan Reedy | 9862b51 | 2016-07-05 21:51:56 -0400 | [diff] [blame^] | 19 | helpfile = join(dirname(dirname(abspath(__file__))), 'help.html') |
Terry Jan Reedy | 01e3575 | 2016-06-10 18:19:21 -0400 | [diff] [blame] | 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 | |
| 33 | if __name__ == '__main__': |
| 34 | unittest.main(verbosity=2) |