ó
‹²,]c           @   s  d  Z  d d l Z d d l Z d d l j Z d d l Z d d l m Z d d l	 m
 Z
 e j e j e j ƒ  e j e ƒ ƒ ƒ Z e j e d ƒ Z e j e ƒ s´ e j e ƒ n  e j d „  ƒ Z d „  Z e d k r e j d	 e j e ƒ d
 d g ƒ n  d S(   s&   Test scripts for `findinfiles` plugin.iÿÿÿÿN(   t   FindInFiles(   t   SELECT_OTHERu   Ã¨Ã¡Ã¯Ã¼ Ã˜Î±Ã´Ã¥ å­—åˆ†è¯¯c         C   s   t  ƒ  } |  j | ƒ | S(   s!   Set up SearchInComboBox combobox.(   R    t	   addWidget(   t   qtbott   findinfiles_plugin(    (    sD   lib/python2.7/site-packages/spyder/plugins/tests/test_findinfiles.pyt   findinfiles   s    	c         C   sû   |  j  j } | j ƒ  | j ƒ  g  k s. t ‚ t t j t ƒ t j t j t ƒ ƒ t g } x. | D]& } | j	 d d | ƒ| j
 t ƒ qb W| j ƒ  | k s¤ t ‚ |  j ƒ  |  j d ƒ | k sÉ t ‚ |  j ƒ  |  j  j } | j ƒ  | k s÷ t ‚ d S(   s}   
    Test that the external paths listed in the combobox are saved and loaded
    correctly from the spyder config file.
    s/   spyder.widgets.findinfiles.getexistingdirectoryt   return_valuet   path_historyN(   t   find_optionst   path_selection_combot   clear_external_pathst   get_external_pathst   AssertionErrort   LOCATIONt   ospt   dirnamet   NONASCII_DIRt   patcht   setCurrentIndexR   t   closing_plugint
   get_optiont   close(   R   R   t   mockerR	   t   expected_resultst   external_path(    (    sD   lib/python2.7/site-packages/spyder/plugins/tests/test_findinfiles.pyt   test_closing_plugin&   s"    
	

t   __main__s   -xs   -vs   -rw(   t   __doc__t   ret   ost   os.patht   pathR   t   pytestt   spyder.plugins.findinfilesR    t   spyder.widgets.findinfilesR   t   realpatht   joint   getcwdR   t   __file__R   R   t   existst   makedirst   fixtureR   R   t   __name__t   maint   basename(    (    (    sD   lib/python2.7/site-packages/spyder/plugins/tests/test_findinfiles.pyt   <module>   s   *
	!