cpython/Lib/idlelib/idle_test/test_config_key.py
terryjreedy c6696feb09 [3.6] bpo-29919 Remove unused imports from idlelib [GH-137] (#2105)
Part of patch by Victor Stinner.
(cherry-pick from d6debb24e0)
2017-06-11 05:53:46 -04:00

33 lines
719 B
Python

''' 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
class GetKeysTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.root = Tk()
cls.root.withdraw()
@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)