1"Test zoomheight, coverage 66%." 2# Some code is system dependent. 3 4from idlelib import zoomheight 5import unittest 6from test.support import requires 7from tkinter import Tk 8from idlelib.editor import EditorWindow 9 10 11class Test(unittest.TestCase): 12 13 @classmethod 14 def setUpClass(cls): 15 requires('gui') 16 cls.root = Tk() 17 cls.root.withdraw() 18 cls.editwin = EditorWindow(root=cls.root) 19 20 @classmethod 21 def tearDownClass(cls): 22 cls.editwin._close() 23 cls.root.update_idletasks() 24 for id in cls.root.tk.call('after', 'info'): 25 cls.root.after_cancel(id) # Need for EditorWindow. 26 cls.root.destroy() 27 del cls.root 28 29 def test_init(self): 30 zoom = zoomheight.ZoomHeight(self.editwin) 31 self.assertIs(zoom.editwin, self.editwin) 32 33 def test_zoom_height_event(self): 34 zoom = zoomheight.ZoomHeight(self.editwin) 35 zoom.zoom_height_event() 36 37 38if __name__ == '__main__': 39 unittest.main(verbosity=2) 40