ยปCore Development>Code coverage>Lib/idlelib/idle_test/test_help.py

Python code coverage for Lib/idlelib/idle_test/test_help.py

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