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

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

#countcontent
1n/a''' Test idlelib.config_key.
2n/a
3n/aCoverage: 56% from creating and closing dialog.
4n/a'''
5n/afrom idlelib import config_key
6n/afrom test.support import requires
7n/arequires('gui')
8n/aimport unittest
9n/afrom tkinter import Tk, Text
10n/a
11n/a
12n/aclass GetKeysTest(unittest.TestCase):
13n/a
14n/a @classmethod
15n/a def setUpClass(cls):
16n/a cls.root = Tk()
17n/a cls.root.withdraw()
18n/a
19n/a @classmethod
20n/a def tearDownClass(cls):
21n/a cls.root.update() # Stop "can't run event command" warning.
22n/a cls.root.destroy()
23n/a del cls.root
24n/a
25n/a
26n/a def test_init(self):
27n/a dia = config_key.GetKeysDialog(
28n/a self.root, 'test', '<<Test>>', ['<Key-F12>'], _utest=True)
29n/a dia.Cancel()
30n/a
31n/a
32n/aif __name__ == '__main__':
33n/a unittest.main(verbosity=2)