|G_Tc@sdZddlmZddlmZddlZidd6idd6ed 6d 6d d 6Zid d6id 6dd 6Z idd6id 6dd 6Z idd6id 6dd 6Z idd6idd6ed 6d 6dd 6Z idd6id 6dd 6Z idd6id 6dd 6Zidd6idd6dd6dhd6ed 6d 6d d 6Zid!d6id"d6ed 6d 6d#d 6Zid$d6id%d6d&d'6d(gd)6ed 6d 6d*d 6Zid+d6id 6d,d 6Zidd6id 6d-d 6Zid.d6id 6d/d 6Zid0d6id 6d1d 6Zid2d6id 6d3d 6Zid4d6id 6d5d 6Zid6d6id 6d7d 6Zid8d6id 6d9d 6Zid:d6id 6d;d 6Zid<d6id 6d=d 6Zid>d6id 6d?d 6Zid@d6id 6dAd 6ZidBd6id 6dCd 6ZidDd6idEd6dFdGdH6ed 6d 6dId 6ZidJd6id 6dKd 6Z idLd6id 6dMd 6Z!idNd6id 6dOd 6Z"idPd6id 6dQd 6Z#dRZ$e%dSkre$ndS(TsRun human tests of Idle's window, dialog, and popup widgets. run(*tests) Run each callable in tests after finding the matching test spec in this file. If there are none, run an htest for each spec dict in this file after finding the matching callable in the module named in the spec. In a tested module, let X be a global name bound to a widget callable. End the module with if __name__ == '__main__': from idlelib.idle_test.htest import run run(X) The X object must have a .__name__ attribute and a 'parent' parameter. X will often be a widget class, but a callable instance with .__name__ or a wrapper function also work. The name of wrapper functions, like '_editor_window', should start with '_'. This file must contain a matching instance of the following template, with X.__name__ prepended, as in '_editor_window_spec ...'. _spec = { 'file': '', 'kwds': {'title': ''}, 'msg': "" } file (no .py): used in run() to import the file and get X. kwds: passed to X (**kwds), after 'parent' is added, to initialize X. title: an example; used for some widgets, delete if not. msg: displayed in a master window. Hints as to how the user might test the widget. Close the window to skip or end the test. Modules not being tested at the moment: PyShell.PyShellEditorWindow Debugger.Debugger AutoCompleteWindow.AutoCompleteWindow OutputWindow.OutputWindow (indirectly being tested with grep test) i(t import_module(t_initializeTkVariantTestsNt aboutDialogtfilesaboutDialog testttitlet_htesttkwdssaTest every button. Ensure Python, TK and IDLE versions are correctly displayed. [Close] to exit.tmsgt CallTipWindowsHTyping '(' should display a calltip. Typing ') should hide the calltip. t ClassBrowsersInspect names of module, class(with superclass if applicable), methods and functions. Toggle nested items. Double clicking on items prints a traceback for an exception that is ignored.tColorDelegatorsThe text is sample Python code. Ensure components like comments, keywords, builtins, string, definitions, and break are correctly colored. The default color scheme is in idlelib/config-highlight.deft configDialogtSettingssIDLE preferences dialog. In the 'Fonts/Tabs' tab, changing font face, should update the font face of the text in the area below it. In the 'Highlighting' tab, try different color schemes. Clicking items in the sample program should update the choices above it. In the 'Keys' and 'General' tab, test settings of interest. [Ok] to close the dialog.[Apply] to apply the settings and and [Cancel] to revert all changes. Re-run the test to ensure changes made have persisted.tdynOptionMenuWidgetsSelect one of the many options in the 'old option set'. Click the button to change the option set. Select one of the many options in the 'new option set'.t EditorWindows"Test editor functions of interest.tconfigSectionNameDialogsGet NamesEnter somethingtmessagetabct used_namessAfter the text entered with [Ok] is stripped, , 'abc', or more that 30 chars are errors. Close 'Get Name' with a valid entry (printed to Shell), [Cancel], or [X]tconfigHelpSourceEditsGet helpsources%Enter menu item name and help file path and more than 30 chars are invalid menu item names. , file does not exist are invalid path items. Test for incomplete web address for help file path. A valid entry will be printed to shell with [0k]. [Cancel] will print None to shelltkeybindingDialogsTest keybindingss find-againtactionttcurrentKeySequencessTest for different key modifier sequences. is invalid. No modifier key is invalid. Shift key with [a-z],[0-9], function key, move key, tab, spaceis invalid. No validitity checking if advanced key binding entry is used.t GrepDialogsClick the 'Show GrepDialog' button. Test the various 'Find-in-files' functions. The results should be displayed in a new '*Output*' window. 'Right-click'->'Goto file/line' anywhere in the search results should open that file in a new EditorWindow.sPIf the help text displays, this works. Text is selectable. Window is scrollable.t IOBindingsnTest the following bindings to display open window from file dialog. to save the file t MultiCallsThe following actions should trigger a print to console or IDLE Shell. Entering and leaving the text area, key entry, , , , , , and focusing out of the window are sequences to be tested.tMultiStatusBarsjEnsure presence of multi-status bar below text area. Click 'Update Status' to change the multi-status textt ObjectBrowsersDouble click on items upto the lowest level. Attributes of the objects and related information will be displayed side-by-side at each level.t PathBrowsersTest for correct display of all paths in sys.path. Toggle nested items upto the lowest level. Double clicking on an item prints a traceback for an exception that is ignored.t Percolators@There are two tracers which can be toggled using a checkbox. Toggling a tracer 'on' by checking it should print traceroutput to the console or to the IDLE shell. If both the tracers are 'on', the output from the tracer which was switched 'on' later, should be printed first Test for actions like text entry, and removal.t ReplaceDialogsClick the 'Replace' button. Test various replace options in the 'Replace dialog'. Click [Close] or [X] to close the 'Replace Dialog'.t SearchDialogsClick the 'Search' button. Test various search options in the 'Search dialog'. Click [Close] or [X] to close the 'Search Dialog'.t ScrolledListsYou should see a scrollable list of items Selecting (clicking) or double clicking an item prints the name to the console or Idle shell. Right clicking an item will display a popup.t StackViewersA stacktrace for a NameError exception. Expand 'idlelib ...' and ''. Check that exc_value, exc_tb, and exc_type are correct. t tabbedpagessToggle between the two tabs 'foo' and 'bar' Add a tab by entering a suitable name for it. Remove an existing tab by entering its name. Remove all existing tabs. is an invalid add page and remove page name. ttextViews Test textViews-The quick brown fox jumps over the lazy dog. i#ttextsNTest for read-only property of text. Text is selectable. Window is scrollable.tToolTipsPPlace mouse cursor over both the buttons A tooltip should appear with some text.t TreeWidgetsDThe canvas is scrollable. Click on folders upto to the lowest level.t UndoDelegatorsClick [Undo] to undo any action. Click [Redo] to redo any action. Click [Dump] to dump the current state by printing to the console or the IDLE shell. tWidgetRedirectorsEEvery text insert should be printed to the console.or the IDLE shell.c stjjdjddttjdd}|jtj|ddjdj ddd d d d d tj |dj }j d|j |jdddddtjdddddtg|rIx|D]:}t|jd}|j|d<j||fqWnxtjD]n\}}|jdrY|d |}|d)s                                             B