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).
This commit is contained in:
Terry Jan Reedy 2018-06-19 19:12:52 -04:00 committed by GitHub
parent 00f9edb98d
commit 4d92158f4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 358 additions and 97 deletions

View file

@ -1,18 +1,19 @@
'''Test functions and SearchEngine class in idlelib.searchengine.py.'''
"Test searchengine, coverage 99%."
from idlelib import searchengine as se
import unittest
# from test.support import requires
from tkinter import BooleanVar, StringVar, TclError # ,Tk, Text
import tkinter.messagebox as tkMessageBox
from idlelib.idle_test.mock_tk import Var, Mbox
from idlelib.idle_test.mock_tk import Text as mockText
import re
# With mock replacements, the module does not use any gui widgets.
# The use of tk.Text is avoided (for now, until mock Text is improved)
# by patching instances with an index function returning what is needed.
# This works because mock Text.get does not use .index.
import re
import unittest
# from test.support import requires
from tkinter import BooleanVar, StringVar, TclError # ,Tk, Text
import tkinter.messagebox as tkMessageBox
from idlelib import searchengine as se
from idlelib.idle_test.mock_tk import Var, Mbox
from idlelib.idle_test.mock_tk import Text as mockText
# The tkinter imports are used to restore searchengine.
def setUpModule():
# Replace s-e module tkinter imports other than non-gui TclError.
@ -326,4 +327,4 @@ class ForwardBackwardTest(unittest.TestCase):
if __name__ == '__main__':
unittest.main(verbosity=2, exit=2)
unittest.main(verbosity=2)