| 
									
										
										
										
											2016-06-04 15:54:44 -04:00
										 |  |  | '''Test idlelib.configDialog.
 | 
					
						
							| 
									
										
										
										
											2014-07-14 23:07:32 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-03 23:53:56 -04:00
										 |  |  | Coverage: 46% just by creating dialog. | 
					
						
							|  |  |  | The other half is code for working with user customizations. | 
					
						
							| 
									
										
										
										
											2014-07-14 23:07:32 -04:00
										 |  |  | '''
 | 
					
						
							| 
									
										
										
										
											2016-06-04 15:54:44 -04:00
										 |  |  | from idlelib.configDialog import ConfigDialog  # always test import | 
					
						
							| 
									
										
										
										
											2014-07-14 23:07:32 -04:00
										 |  |  | from test.support import requires | 
					
						
							| 
									
										
										
										
											2016-06-04 15:54:44 -04:00
										 |  |  | requires('gui') | 
					
						
							| 
									
										
										
										
											2014-07-14 23:07:32 -04:00
										 |  |  | from tkinter import Tk | 
					
						
							| 
									
										
										
										
											2016-06-04 15:54:44 -04:00
										 |  |  | import unittest | 
					
						
							|  |  |  | from idlelib import macosxSupport as macosx | 
					
						
							| 
									
										
										
										
											2014-07-14 23:07:32 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | class ConfigDialogTest(unittest.TestCase): | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @classmethod | 
					
						
							|  |  |  |     def setUpClass(cls): | 
					
						
							|  |  |  |         cls.root = Tk() | 
					
						
							| 
									
										
										
										
											2016-06-04 15:54:44 -04:00
										 |  |  |         macosx._initializeTkVariantTests(cls.root) | 
					
						
							| 
									
										
										
										
											2014-07-14 23:07:32 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @classmethod | 
					
						
							|  |  |  |     def tearDownClass(cls): | 
					
						
							| 
									
										
										
										
											2016-06-03 23:53:56 -04:00
										 |  |  |         cls.root.update_idletasks() | 
					
						
							| 
									
										
										
										
											2014-07-14 23:07:32 -04:00
										 |  |  |         cls.root.destroy() | 
					
						
							|  |  |  |         del cls.root | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_dialog(self): | 
					
						
							| 
									
										
										
										
											2016-06-03 23:53:56 -04:00
										 |  |  |         d = ConfigDialog(self.root, 'Test', _utest=True) | 
					
						
							| 
									
										
										
										
											2016-05-16 22:27:28 -04:00
										 |  |  |         d.remove_var_callbacks() | 
					
						
							| 
									
										
										
										
											2014-07-14 23:07:32 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if __name__ == '__main__': | 
					
						
							|  |  |  |     unittest.main(verbosity=2) |