diff options
| author | Terry Jan Reedy <tjreedy@udel.edu> | 2018-06-19 19:12:52 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-19 19:12:52 -0400 |
| commit | 4d92158f4c3917fc4fbfebff15224e74782abf79 (patch) | |
| tree | a3eea4b4e5e9d9b9b679eb538d9716758776c3bb /Lib/idlelib/idle_test/test_zoomheight.py | |
| parent | 00f9edb98dd64e14daf5c44f303deca5cbc3cdeb (diff) | |
| download | cpython-git-4d92158f4c3917fc4fbfebff15224e74782abf79.tar.gz | |
bpo-33855: Still more edits and minimal tests for IDLE (GH-7784)
Part 3 of 3, continuing PR #7689. This covers 14 idlelib modules and their tests,
rpc to zoomheight except for run (already done) and tooltip (being done separately).
Diffstat (limited to 'Lib/idlelib/idle_test/test_zoomheight.py')
| -rw-r--r-- | Lib/idlelib/idle_test/test_zoomheight.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Lib/idlelib/idle_test/test_zoomheight.py b/Lib/idlelib/idle_test/test_zoomheight.py new file mode 100644 index 0000000000..bac86ac249 --- /dev/null +++ b/Lib/idlelib/idle_test/test_zoomheight.py @@ -0,0 +1,39 @@ +"Test zoomheight, coverage 66%." +# Some code is system dependent. + +from idlelib import zoomheight +import unittest +from test.support import requires +from tkinter import Tk, Text +from idlelib.editor import EditorWindow + + +class Test(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.editwin = EditorWindow(root=cls.root) + + @classmethod + def tearDownClass(cls): + cls.editwin._close() + cls.root.update_idletasks() + for id in cls.root.tk.call('after', 'info'): + cls.root.after_cancel(id) # Need for EditorWindow. + cls.root.destroy() + del cls.root + + def test_init(self): + zoom = zoomheight.ZoomHeight(self.editwin) + self.assertIs(zoom.editwin, self.editwin) + + def test_zoom_height_event(self): + zoom = zoomheight.ZoomHeight(self.editwin) + zoom.zoom_height_event() + + +if __name__ == '__main__': + unittest.main(verbosity=2) |
