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