ok

Mini Shell

Direktori : /opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/htest.cpython-36.pyc

3

*j�a�6�@s�dZddlZddlmZddlZddlmZej	�dddd�d	d
�Z
didd
�Zd
idd
�Zdidd
�Z
dddd�dd
�Zdidd
�Zdidd
�Zddddgdd�dd
�Zdidd
�Zd d!d"ed#hdd$�d%d
�Zd&id'd
�Zd(id)d
�Zd*id+d
�Zd,id-d
�Zd.id/d
�Zd0id1d
�Zd d2d3d4dd5�d6d
�Zd7id8d
�Zd9id:d
�Zd;id<d
�Zd=id>d
�Zd?id@d
�Z dAidBd
�Z!dCidDd
�Z"dEidFd
�Z#dGidHd
�Z$dIdJdKdLddM�dNd
�Z%dOidPd
�Z&dQdR�Z'e(dSk�r�e'�dS)Ta�Run human tests of Idle's window, dialog, and popup widgets.

run(*tests)
Create a master Tk window.  Within that, run each callable in tests
after finding the matching test spec in this file.  If tests is empty,
run an htest for each spec dict in this file after finding the matching
callable in the module named in the spec.  Close the window to skip or
end the test.

In a tested module, let X be a global name bound to a callable (class
or function) whose .__name__ attribute is also X (the usual situation).
The first parameter of X must be 'parent'.  When called, the parent
argument will be the root window.  X must create a child Toplevel
window (or subclass thereof).  The Toplevel may be a test widget or
dialog, in which case the callable is the corresonding class.  Or the
Toplevel may contain the widget to be tested or set up a context in
which a test widget is invoked.  In this latter case, the callable is a
wrapper function that sets up the Toplevel and other objects.  Wrapper
function names, such as _editor_window', should start with '_'.


End the module with

if __name__ == '__main__':
    <unittest, if there is one>
    from idlelib.idle_test.htest import run
    run(X)

To have wrapper functions and test invocation code ignored by coveragepy
reports, put '# htest #' on the def statement header line.

def _wrapper(parent):  # htest #

Also make sure that the 'if __name__' line matches the above.  Then have
make sure that .coveragerc includes the following.

[report]
exclude_lines =
    .*# htest #
    if __name__ == .__main__.:

(The "." instead of "'" is intentional and necessary.)


To run any X, this file must contain a matching instance of the
following template, with X.__name__ prepended to '_spec'.
When all tests are run, the prefix is use to get X.

_spec = {
    'file': '',
    'kwds': {'title': ''},
    'msg': ""
    }

file (no .py): run() imports file.py.
kwds: augmented with {'parent':root} and passed to X as **kwds.
title: an example kwd; some widgets need this, delete if not.
msg: master window hints about testing the widget.


Modules and classes not being tested at the moment:
pyshell.PyShellEditorWindow
debugger.Debugger
autocomplete_w.AutoCompleteWindow
outwin.OutputWindow (indirectly being tested with grep test)
�N)�
import_module)�	ScrollbarZ
help_aboutzhelp_about testT)�title�_htestzaTest every button. Ensure Python, TK and IDLE versions are correctly displayed.
 [Close] to exit.)�file�kwds�msgZ	calltip_wz�Typing '(' should display a calltip.
Typing ') should hide the calltip.
So should moving cursor out of argument area.
Force-open-calltip does not work here.
Zbrowserz�Inspect 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	colorizerz�The 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configdialogZConfigDialogTesta�IDLE 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	dynoptionz�Select 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�)r�actionZcurrentKeySequencesrz�Test for different key modifier sequences.
<nothing> 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.Zgrepz�Click 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 source�test�abc)rZmenuitem�filepathZ
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 <Return> prints valid entry to shell
[Cancel] or <Escape> prints None to shellZiomenuaTest the following bindings.
<Control-o> to open file from dialog.
Edit the file.
<Control-p> to print the file.
<Control-s> to save the file.
<Alt-s> to save-as another file.
<Control-c> 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, <Control-Key>,
<Alt-Key-a>, <Control-Key-a>, <Alt-Control-Key-a>, 
<Control-Button-1>, <Alt-Button-1> 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 textZdebugobjz�Double click on items upto the lowest level.
Attributes of the objects and related information will be displayed side-by-side at each level.Zpathbrowserz�Test 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)r�messageZtext0rz�Enter with <Return> or [Ok].  Print valid entry to Shell
Blank line, after stripping, is ignored
Close dialog with valid entry, <Escape>, [Cancel], [X]�replacez�Click the 'Replace' button.
Test various replace options in the 'Replace dialog'.
Click [Close] or [X] to close the 'Replace Dialog'.�searchz�Click 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scrolledlistz�You 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.Zstackviewerz�A stacktrace for a NameError exception.
Expand 'idlelib ...' and '<locals>'.
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.Zundoz�Click [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.
�#)r�textrzFTest 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s�tj���jd��jdd�tj�dd�}|j�tj|dd���j�jd�dd	d
d�t	|�j
d�}�j|jd
�|jdddd��jdddd�g�|r�x�|D],}t
�|jd}|j|d<�j||f�q�Wnbx`t
�j�D]R\}}|jd�r�|dd&��|}�|d<td|d�}t|��}�j||f�q�Wtj���d�d��������fdd�}d'��fdd�	}	d(�fdd�	}
tj��d |	d!�}tj�d"|d#��|j��j��j��jd$|	��jd%|
�|��j�dS))Nz
IDLE htestr�
)ZpadxZword)Zwrap�bgZflat��F)rZreliefZheight�width)�command)Zyscrollcommand�right�yF)ZsideZfill�expand�leftZbothT�_spec�name�zidlelib.rcszt��dkr�j��j�\}�|d���d<�jd|d��jdd��jdd	��jd|d
��jdd�dS)N�r�parentzTest rZnormal)�statez1.0�endrZdisabled)�lenZpack_forget�pop�set�	configure�delete�insert)�	test_spec)�callable_object�next_button�root�	test_kwds�	test_list�	test_namer��</opt/alt/python36/lib64/python3.6/idlelib/idle_test/htest.py�	next_testyszrun.<locals>.next_testcs2�f��}yt|j�Wntk
r,YnXdS)N)�print�result�AttributeError)�_Zwidget)r,r/r2r3�run_test�s

zrun.<locals>.run_testcs�j�dS)N)Zdestroy)r8)r.r2r3�close�szrun.<locals>.closeZactive)Ztextvariable�defaultrZNext)rrz<Key-Return>z<Key-Escape>���)N)N)�tkZTkrZ	resizableZFrameZpackZTextr(ZcgetrZyview�configr'�globals�__name__�append�items�endswithr�getattrZ	StringVarZButtonZ	focus_setZbindZmainloop)ZtestsZ
frameLabelZ	scrollbarrr+�k�d�modr4r9r:Zbuttonr2)r,r-r.r/r0r1rr3�runVsR






rH�__main__))�__doc__Zidlelib.pyshellZidlelib�	importlibrZtkinterr=Ztkinter.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_specrHr@r2r2r2r3�<module>Bs�	
	H


Zerion Mini Shell 1.0