3 2a6@sddlZddlmZddlZddlmZejdddddd Z d id d Z d id d Z didd Z dddddd Z didd Zdidd Zddddgdddd Zdidd Zdd d!ed"hdd#d$d Zd%id&d Zd'id(d Zd)id*d Zd+id,d Zd-id.d Zd/id0d Zdd1d2d3dd4d5d Zd6id7d Zd8id9d Zd:id;d Zdid?d Zd@idAd Z dBidCd Z!dDidEd Z"dFidGd Z#dHdIdJdKddLdMd Z$dNidOd Z%dPdQZ&e'dRkre&dS)SN) import_module) ScrollbarZ help_aboutzhelp_about testT)title_htestzaTest every button. Ensure Python, TK and IDLE versions are correctly displayed. [Close] to exit.)filekwdsmsgZ calltip_wzTyping '(' should display a calltip. Typing ') should hide the calltip. So should moving cursor out of argument area. Force-open-calltip does not work here. ZbrowserzInspect 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.Z colorizerzThe 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.defZ configdialogZConfigDialogTestaIDLE 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', 'General' and 'Extensions' tabs, 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.Z dynoptionzSelect 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'.Zeditorz>Test editor functions of interest. Best to close editor first.Z config_keyzTest keybindingsz find-again)ractionZcurrentKeySequencesrzTest for different key modifier sequences. is invalid. No modifier key is invalid. Shift key with [a-z],[0-9], function key, move key, tab, space is invalid. No validity checking if advanced key binding entry is used.ZgrepzClick the 'Show GrepDialog' button. Test the various 'Find-in-files' functions. The results should be displayed in a new '*Output*' window. 'Right-click'->'Go to file/line' anywhere in the search results should open that file in a new EditorWindow.ZqueryzHelp name and sourcetestabc)rZmenuitemfilepathZ used_namesraOEnter menu item name and help file path '', > than 30 chars, and 'abc' are invalid menu item names. '' and file does not exist are invalid path items. Any url ('www...', 'http...') is accepted. Test Browse with and without path, as cannot unittest. [Ok] or prints valid entry to shell [Cancel] or prints None to shellZiomenuaTest the following bindings. to open file from dialog. Edit the file. to print the file. to save the file. to save-as another file. to save-copy-as another file. Check that changes were saved by opening the file elsewhere.Z multicallaThe 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.Z statusbarzjEnsure presence of multi-status bar below text area. Click 'Update Status' to change the multi-status textZdebugobjzDouble click on items upto the lowest level. Attributes of the objects and related information will be displayed side-by-side at each level.Z pathbrowserzTest 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.Z percolatoraAThere are two tracers which can be toggled using a checkbox. Toggling a tracer 'on' by checking it should print tracer output 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.ZQueryzEnter somethingZGo)rmessageZtext0rzEnter with or [Ok]. Print valid entry to Shell Blank line, after stripping, is ignored Close dialog with valid entry, , [Cancel], [X]replacezClick the 'Replace' button. Test various replace options in the 'Replace dialog'. Click [Close] or [X] to close the 'Replace Dialog'.searchzClick the 'Search' button. Test various search options in the 'Search dialog'. Click [Close] or [X] to close the 'Search Dialog'.Z searchbasezKCheck the appearance of the base search dialog Its only action is to close.Z scrolledlistzYou 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.helpzPIf the help text displays, this works. Text is selectable. Window is scrollable.Z stackviewerzA stacktrace for a NameError exception. Expand 'idlelib ...' and ''. Check that exc_value, exc_tb, and exc_type are correct. ZtooltipzPPlace mouse cursor over both the buttons A tooltip should appear with some text.ZtreezDThe canvas is scrollable. Click on folders upto to the lowest level.ZundozClick [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. Ztextviewz Test textviewz-The quick brown fox jumps over the lazy dog. #)rtextrzFTest for read-only property of text. Select text, scroll window, closeZ redirectorzEEvery text insert should be printed to the console or the IDLE shell.c stjjdjddtjdd}|jtj|ddjjddd d d t |j d }j |j d |jddddjddddg|rx|D],}t |jd}|j|d<j||fqWnbx`t jD]R\}}|jdr|dd&|}|d<td|d}t|}j||fqWtjddfdd}d'fdd } d(fdd } tjd | d!} tjd"|d#| jjjjd$| jd%| |jdS))Nz IDLE htestr )ZpadxZword)wrapbgZflatF)rZreliefZheightwidth)command)ZyscrollcommandrightyF)ZsidefillexpandleftZbothT_specnamezidlelib.rcsztdkrjj\}|dd<jd|djddjdd jd|d jd ddS) NrparentzTest r!Znormal)statez1.0endrZdisabled)lenZ pack_forgetpopset configuredeleteinsert) test_spec)callable_object next_buttonroot test_kwds test_list test_namer*/opt/alt/python36/lib64/python3.6/htest.py next_testys    zrun..next_testc s2f}yt|jWntk r,YnXdS)N)printresultAttributeError)_Zwidget)r.r1r4r5run_tests  zrun..run_testcs jdS)N)Zdestroy)r:)r0r4r5closeszrun..closeZactive)Z textvariabledefaultrZNext)rrz z )N)N)tkZTkrZ resizableZFramepackZTextr*ZcgetrZyviewconfigr)globals__name__appenditemsendswithrgetattrZ StringVarZButtonZ focus_setZbindZmainloop) ZtestsZ frameLabelZ scrollbarr r-kdmodr6r;r<Zbuttonr4)r.r/r0r1r2r3rr5runVsR           rK__main__)(Zidlelib.pyshellZidlelib importlibrZtkinterr?Z tkinter.ttkrZ NoDefaultRootZAboutDialog_specZ_calltip_window_specZ_module_browser_specZ_color_delegator_specZConfigDialog_specZ_dyn_option_menu_specZ_editor_window_specZGetKeysDialog_specZ_grep_dialog_spec__file__ZHelpSource_specZ_io_binding_specZ_multi_call_specZ_multistatus_bar_specZ_object_browser_specZ_path_browser_specZ_percolator_specZ Query_specZ_replace_dialog_specZ_search_dialog_specZ_searchbase_specZ_scrolled_list_specZshow_idlehelp_specZ_stack_viewer_specZ _tooltip_specZ_tree_widget_specZ_undo_delegator_specZViewWindow_specZ_widget_redirector_specrKrCr4r4r4r5Ds      H