???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
{fc           @   s¶   d  Z  d d l Z d d l m Z d d l m Z m Z m Z m Z d d l	 m
 Z d d l	 m Z d d l m Z d e j f d	 „  ƒ  YZ e d
 k r² e j d d d d ƒ n  d S(   s©   Unittests for idlelib/SearchDialogBase.py

Coverage: 99%. The only thing not covered is inconsequential --
testing skipping of suite when self.needwrapbutton is false.

iÿÿÿÿN(   t   requires(   t   Textt   Tkt   Toplevelt   Frame(   t   SearchEngine(   t   SearchDialogBase(   t   Funct   SearchDialogBaseTestc           B   s’   e  Z e d  „  ƒ Z e d „  ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z RS(   c         C   s   t  d ƒ t ƒ  |  _ d  S(   Nt   gui(   R    R   t   root(   t   cls(    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt
   setUpClass   s    
c         C   s   |  j  j ƒ  |  `  d  S(   N(   R
   t   destroy(   R   (    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   tearDownClass    s    c         C   s:   t  j |  j ƒ |  _ t j d |  j d |  j ƒ |  _ d  S(   NR
   t   engine(   t   seR   R
   R   t   sdbR   t   dialog(   t   self(    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   setUp%   s    c         C   s   |  j  j ƒ  d  S(   N(   R   t   close(   R   (    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   tearDown)   s    c         C   sÆ   d  |  j _ t |  j ƒ } t | ƒ } |  j j | ƒ |  j |  j j j	 ƒ  d ƒ |  j j
 ƒ  |  j |  j j j	 ƒ  d ƒ |  j j | d d ƒ|  j |  j j j ƒ  d ƒ | j ƒ  | j ƒ  d  S(   Nt   normalt	   withdrawnt   searchphraset   hello(   t   NoneR   t   default_commandR   R
   R   t   opent   assertEqualt   topt   stateR   t   entt   gett   update_idletasksR   (   R   t   toplevelt   text(    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   test_open_and_close,   s    
c         C   s±   t  ƒ  |  j _ t  ƒ  |  j _ t  ƒ  |  j _ t  ƒ  |  j _ d  |  j _ |  j j ƒ  |  j	 |  j j j
 ƒ |  j	 |  j j j
 ƒ |  j	 |  j j j
 ƒ |  j	 |  j j j
 ƒ d  S(   N(   R   R   t   create_entriest   create_option_buttonst   create_other_buttonst   create_command_buttonsR   R   t   create_widgetst
   assertTruet   called(   R   (    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   test_create_widgets<   s    c         C   së   |  j  } d |  j _ t |  j ƒ |  j _ |  j j d d ƒ \ } } | | d d ƒ |  j | j ƒ  d ƒ | j	 ƒ  } | t
 | d ƒ d ƒ | t
 | d ƒ d ƒ | t
 | d ƒ d ƒ | t
 | d	 ƒ d ƒ | |  j j d ƒ d  S(
   Ni    s   Test:R   R%   t   rowt   columni   t   rowspant
   columnspan(   R   R   R/   R   R
   R   t
   make_entryt   assertInR"   t	   grid_infot   int(   R   t   equalt   entryt   labelt   egi(    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   test_make_entryJ   s    	c         C   sI   d |  j  _ |  j j d ƒ |  j  j ƒ  |  j |  j  j j ƒ  d ƒ d  S(   Ni    R   (   R   R/   R   t   setpatR'   R4   R!   R"   (   R   (    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   test_create_entriesY   s    c         C   s–   d |  j  _ t |  j ƒ |  j  _ |  j  j ƒ  \ } } |  j | d ƒ |  j | t ƒ |  j  j d ƒ \ } } |  j | d d ƒ |  j | t ƒ d  S(   Ni    t    t	   testlabelR%   (	   R   R/   R   R
   R   t
   make_frameR   t   assertIsInstanceR   (   R   t   frameR9   (    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   test_make_frame_   s    c         C   s(   t  |  j ƒ |  j _ d |  j _ | ƒ  S(   Ni    (   R   R
   R   R   R/   (   R   t   meth(    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   btn_test_setupj   s    c   	      C   s  |  j  } xø d D]ð } x3 | j | j | j | j f D] } | j | ƒ q5 W|  j |  j j ƒ \ } } x– t	 | | j
 ƒ  ƒ D] \ } } | \ } } |  j | d | ƒ |  j | j ƒ  | ƒ | d k rØ | j ƒ  n
 | j ƒ  |  j | j ƒ  d | ƒ q} Wq Wd  S(   Ni    i   R%   (   i    i   (   R   t   revart   casevart   wordvart   wrapvart   setRE   R   R(   t   zipt   pack_slavesR   R"   t   deselectt   select(	   R   t   eR    t   varRB   t   optionst   spect   buttonR9   (    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   test_create_option_buttonso   s    	%"
c   
      C   s  x	t  t f D]û } |  j j } | j | ƒ |  j |  j j ƒ \ } } | j ƒ  } x² t	 | | ƒ D]¡ \ } } | \ } }	 |  j
 | d |	 ƒ | | k rc |  j
 | j ƒ  | ƒ | | j ƒ  |  j
 | j ƒ  d | ƒ | d | j ƒ  |  j
 | j ƒ  | ƒ qc qc Wq Wd  S(   NR%   i   (   t   Falset   TrueR   t   backvarRJ   RE   R   R)   RL   RK   R   R"   RN   (
   R   R    RP   RB   t   otherst   buttonsRR   RS   t   valR9   (    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   test_create_other_buttons€   s    c         C   s`   t  |  j ƒ |  j _ t |  j j ƒ |  j _ |  j j d |  j j ƒ } |  j | d d ƒ d  S(   Nt   TestR%   (	   R   R
   R   R   R   t   buttonframet   make_buttonR   R   (   R   t   btn(    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   test_make_button“   s    c         C   sa   |  j  j ƒ  d } x7 |  j  j j ƒ  D]# } | d d k r& | d } q& q& W|  j d | ƒ d  S(   NR>   R%   R   t   command(   R   R*   R]   t   winfo_childrenR4   (   R   t   closebuttoncommandt   child(    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   test_create_command_buttons™   s    (   t   __name__t
   __module__t   classmethodR   R   R   R   R&   R.   R;   R=   RC   RE   RT   R[   R`   Re   (    (    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyR      s   											t   __main__t	   verbosityi   t   exit(   t   __doc__t   unittestt   test.test_supportR    t   TkinterR   R   R   R   t   idlelibR   R   R   R   t   idlelib.idle_test.mock_idleR   t   TestCaseR   Rf   t   main(    (    (    s?   /usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt   <module>   s   "‹