test_zoomheight.py 999 B

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