summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test/test_config_key.py
blob: 59d8e817e30588a07e43e3636328b08053305f9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
''' Test idlelib.config_key.

Coverage: 56% from creating and closing dialog.
'''
from idlelib import config_key
from test.support import requires
requires('gui')
import unittest
from tkinter import Tk, Text


class GetKeysTest(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        cls.root = Tk()

    @classmethod
    def tearDownClass(cls):
        cls.root.update()  # Stop "can't run event command" warning.
        cls.root.destroy()
        del cls.root


    def test_init(self):
        dia = config_key.GetKeysDialog(
            self.root, 'test', '<<Test>>', ['<Key-F12>'], _utest=True)
        dia.Cancel()


if __name__ == '__main__':
    unittest.main(verbosity=2)