2016-06-10 19:19:21 -03:00
|
|
|
''' Test idlelib.config_key.
|
|
|
|
|
2016-08-10 16:15:25 -03:00
|
|
|
Coverage: 56% from creating and closing dialog.
|
2016-06-10 19:19:21 -03:00
|
|
|
'''
|
|
|
|
from idlelib import config_key
|
|
|
|
from test.support import requires
|
|
|
|
requires('gui')
|
|
|
|
import unittest
|
2017-06-11 06:53:46 -03:00
|
|
|
from tkinter import Tk
|
2016-06-10 19:19:21 -03:00
|
|
|
|
|
|
|
|
|
|
|
class GetKeysTest(unittest.TestCase):
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def setUpClass(cls):
|
|
|
|
cls.root = Tk()
|
2016-08-31 22:09:02 -03:00
|
|
|
cls.root.withdraw()
|
2016-06-10 19:19:21 -03:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def tearDownClass(cls):
|
2016-08-10 16:15:25 -03:00
|
|
|
cls.root.update() # Stop "can't run event command" warning.
|
2016-06-10 19:19:21 -03:00
|
|
|
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)
|