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