ó
§xxTc           @   sÊ  d  Z  d d l m Z d d l m Z d d l Z i d d 6i d d 6e d	 6d
 6d d 6Z i d d 6i  d
 6d d 6Z	 i d d 6i  d
 6d d 6Z
 i d d 6i  d
 6d d 6Z i d d 6i d d 6e d	 6d
 6d d 6Z i d d 6i  d
 6d d 6Z i d d 6i  d
 6d d 6Z i d d 6i d d 6d d 6d h d 6e d	 6d
 6d  d 6Z i d! d 6i d" d 6e d	 6d
 6d# d 6Z i d$ d 6i d% d 6d& d' 6d( g d) 6e d	 6d
 6d* d 6Z i d+ d 6i  d
 6d, d 6Z i d d 6i  d
 6d- d 6Z i d. d 6i  d
 6d/ d 6Z i d0 d 6i  d
 6d1 d 6Z i d2 d 6i  d
 6d3 d 6Z i d4 d 6i  d
 6d5 d 6Z i d6 d 6i  d
 6d7 d 6Z i d8 d 6i  d
 6d9 d 6Z i d: d 6i  d
 6d; d 6Z i d< d 6i  d
 6d= d 6Z i d> d 6i  d
 6d? d 6Z i d@ d 6i  d
 6dA d 6Z i dB d 6i  d
 6dC d 6Z i dD d 6i dE d 6dF dG dH 6e d	 6d
 6dI d 6Z i dJ d 6i  d
 6dK d 6Z  i dL d 6i  d
 6dM d 6Z! i dN d 6i  d
 6dO d 6Z" i dP d 6i  d
 6dQ d 6Z# dR „  Z$ e% dS k rÆe$ ƒ  n  d S(T   s°  Run 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__':
    <unittest, if there is one>
    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   aboutDialogt   files   aboutDialog testt   titlet   _htestt   kwdssa   Test every button. Ensure Python, TK and IDLE versions are correctly displayed.
 [Close] to exit.t   msgt   CallTipWindowsH   Typing '(' should display a calltip.
Typing ') should hide the calltip.
t   ClassBrowsers¸   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.t   ColorDelegatorsÆ   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.deft   configDialogt   SettingssÖ  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' 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.t   dynOptionMenuWidgetsš   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'.t   EditorWindows"   Test editor functions of interest.t   configSectionNameDialogs   Get Names   Enter somethingt   messaget   abct
   used_namessª   After the text entered with [Ok] is stripped, <nothing>, 'abc', or more that 30 chars are errors.
Close 'Get Name' with a valid entry (printed to Shell), [Cancel], or [X]t   configHelpSourceEdits   Get helpsources%  Enter menu item name and help file path
 <nothing> and more than 30 chars are invalid menu item names.
<nothing>, 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 shellt   keybindingDialogs   Test keybindingss
   find-againt   actiont    t   currentKeySequencessä   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, spaceis invalid.
No validitity checking if advanced key binding entry is used.t
   GrepDialogsø   Click 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.sP   If the help text displays, this works.
Text is selectable. Window is scrollable.t	   IOBindingsn   Test the following bindings
<Control-o> to display open window from file dialog.
<Control-s> to save the file
t	   MultiCalls  The 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.t   MultiStatusBarsj   Ensure presence of multi-status bar below text area.
Click 'Update Status' to change the multi-status textt   ObjectBrowsersŒ   Double click on items upto the lowest level.
Attributes of the objects and related information will be displayed side-by-side at each level.t   PathBrowsers­   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.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   ReplaceDialogs…   Click the 'Replace' button.
Test various replace options in the 'Replace dialog'.
Click [Close] or [X] to close the 'Replace Dialog'.t   SearchDialogs�   Click the 'Search' button.
Test various search options in the 'Search dialog'.
Click [Close] or [X] to close the 'Search Dialog'.t   ScrolledLists´   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.t   StackViewers…   A stacktrace for a NameError exception.
Expand 'idlelib ...' and '<locals>'.
Check that exc_value, exc_tb, and exc_type are correct.
t   tabbedpagessØ   Toggle 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.
<nothing> is an invalid add page and remove page name.
t   textViews   Test textViews-   The quick brown fox jumps over the lazy dog.
i#   t   textsN   Test for read-only property of text.
Text is selectable. Window is scrollable.t   ToolTipsP   Place mouse cursor over both the buttons
A tooltip should appear with some text.t
   TreeWidgetsD   The canvas is scrollable.
Click on folders upto to the lowest level.t   UndoDelegators—   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.
t   WidgetRedirectorsE   Every text insert should be printed to the console.or the IDLE shell.c       	      s…  t  j ƒ  ‰ ˆ j d ƒ ˆ j d d ƒ t ˆ ƒ t  j ˆ d d ƒ} | j ƒ  t  j | d d ƒ‰ ˆ j d ˆ j	 d ƒ d d	 d
 d d d ƒ t  j
 | d ˆ j ƒ} ˆ j d | j ƒ | j d d d d d t ƒ ˆ j d d d d d t ƒ g  ‰ |  rIxÇ |  D]: } t ƒ  | j d } | j | d <ˆ j | | f ƒ qWn‚ x t ƒ  j ƒ  D]n \ } } | j d ƒ rY| d  ‰ | } ˆ | d <t d | d ƒ } t | ˆ ƒ } ˆ j | | f ƒ qYqYWt  j d ƒ g ‰ d  g ‰  d  g ‰ ‡  ‡ ‡ ‡ ‡ ‡ ‡ f d †  } ‡  ‡ f d †  }	 t  j ˆ d ˆ d d |	 ƒ}
 |
 j ƒ  t  j ˆ d  d! d | ƒ‰ ˆ j ƒ  | ƒ  ˆ j ƒ  d  S("   Ns
   IDLE htesti    t   padxi
   t   wrapt   wordt   bgt   relieft   flatt   heighti   t   widthiF   t   commandt   yscrollcommandt   sidet   rightt   fillt   yt   expandt   leftt   botht   _spect   nameiûÿÿÿs   idlelib.R   R   c             s²   t  ˆ ƒ d k r ˆ j ƒ  n  ˆ j ƒ  \ }  ˆ  d <|  d ˆ d <ˆ ˆ d d <ˆ d j d |  d ƒ ˆ j d d ƒ ˆ j d	 d
 ƒ ˆ j d	 |  d ƒ ˆ j d d ƒ d  S(   Ni   i    R   t   parents   Test R<   t   statet   normals   1.0t   endR   t   disabled(   t   lent   pack_forgett   popt   sett	   configuret   deletet   insert(   t	   test_spec(   t   callable_objectt   next_buttont   roott	   test_kwdst	   test_listt	   test_nameR%   (    sC   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/idle_test/htest.pyt   nextR  s    c             s8   ˆ  d ˆ d �  }  y |  j  GHWn t k
 r3 n Xd  S(   Ni    (   t   resultt   AttributeError(   t   widget(   RJ   RM   (    sC   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/idle_test/htest.pyt   run_test_  s
    t   textvariableR%   t   Next(   t   tkt   TkR   t	   resizableR   t   Framet   packt   TextRF   t   cgett	   Scrollbart   yviewt   configRE   t   Falset   Truet   globalst   __name__t   appendt   itemst   endswithR    t   getattrt	   StringVart   Nonet   Buttont   mainloop(   t   testst
   frameLabelt	   scrollbart   testRI   t   kt   dt   modRP   RT   t   button(    (   RJ   RK   RL   RM   RN   RO   R%   sC   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/idle_test/htest.pyt   run-  sJ    

+

		!

t   __main__(&   t   __doc__t	   importlibR    t   idlelib.macosxSupportR   t   TkinterRW   Rb   t   AboutDialog_spect   _calltip_window_spect   _class_browser_spect   _color_delegator_spect   ConfigDialog_spect   _dyn_option_menu_spect   _editor_window_spect   GetCfgSectionNameDialog_spect   GetHelpSourceDialog_spect   GetKeysDialog_spect   _grep_dialog_spect   _help_dialog_spect   _io_binding_spect   _multi_call_spect   _multistatus_bar_spect   _object_browser_spect   _path_browser_spect   _percolator_spect   _replace_dialog_spect   _search_dialog_spect   _scrolled_list_spect   _stack_viewer_spect   _tabbed_pages_spect   TextViewer_spect   _tooltip_spect   _tree_widget_spect   _undo_delegator_spect   _widget_redirector_specRu   Rd   (    (    (    sC   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/idle_test/htest.pyt   <module>)   s  













	





















	B