| 
									
										
										
										
											2024-01-06 07:23:26 +01:00
										 |  |  | "Test help, coverage 94%." | 
					
						
							| 
									
										
										
										
											2016-06-10 18:19:21 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | from idlelib import help | 
					
						
							| 
									
										
										
										
											2018-06-15 18:20:55 -04:00
										 |  |  | import unittest | 
					
						
							| 
									
										
										
										
											2016-06-10 18:19:21 -04:00
										 |  |  | from test.support import requires | 
					
						
							|  |  |  | requires('gui') | 
					
						
							|  |  |  | from os.path import abspath, dirname, join | 
					
						
							|  |  |  | from tkinter import Tk | 
					
						
							| 
									
										
										
										
											2018-06-15 18:20:55 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-10 18:19:21 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-06 07:23:26 +01:00
										 |  |  | class IdleDocTest(unittest.TestCase): | 
					
						
							| 
									
										
										
										
											2016-06-10 18:19:21 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @classmethod | 
					
						
							|  |  |  |     def setUpClass(cls): | 
					
						
							|  |  |  |         "By itself, this tests that file parsed without exception." | 
					
						
							|  |  |  |         cls.root = root = Tk() | 
					
						
							|  |  |  |         root.withdraw() | 
					
						
							| 
									
										
										
										
											2024-01-06 07:23:26 +01:00
										 |  |  |         cls.window = help.show_idlehelp(root) | 
					
						
							| 
									
										
										
										
											2016-06-10 18:19:21 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @classmethod | 
					
						
							|  |  |  |     def tearDownClass(cls): | 
					
						
							| 
									
										
										
										
											2024-01-06 07:23:26 +01:00
										 |  |  |         del cls.window | 
					
						
							| 
									
										
										
										
											2016-06-10 18:19:21 -04:00
										 |  |  |         cls.root.update_idletasks() | 
					
						
							|  |  |  |         cls.root.destroy() | 
					
						
							|  |  |  |         del cls.root | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-06 07:23:26 +01:00
										 |  |  |     def test_1window(self): | 
					
						
							|  |  |  |         self.assertIn('IDLE Doc', self.window.wm_title()) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_4text(self): | 
					
						
							|  |  |  |         text = self.window.frame.text | 
					
						
							| 
									
										
										
										
											2025-02-08 21:14:47 +01:00
										 |  |  |         self.assertEqual(text.get('1.0', '1.end'), ' IDLE — Python editor and shell ') | 
					
						
							| 
									
										
										
										
											2016-06-10 18:19:21 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-15 18:20:55 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-10 18:19:21 -04:00
										 |  |  | if __name__ == '__main__': | 
					
						
							|  |  |  |     unittest.main(verbosity=2) |