ó
ú2¢\c           @   sÆ   d  Z  d d l Z d d l Z d d l j 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 „  Z d	 „  Z d
 „  Z d „  Z e d „  ƒ Z d S(   s   Test HTML utilsiÿÿÿÿN(   t   check_help_all_output(   t
   url_escapet   url_unescapet	   is_hiddent   is_file_hidden(   t   cast_unicode(   t   TemporaryDirectory(   t   skip_if_not_win32c           C   s   t  d ƒ d S(   s!   jupyter notebook --help-all workst   notebookN(   R    (    (    (    s8   lib/python2.7/site-packages/notebook/tests/test_utils.pyt   test_help_output   s    c          C   st   t  d ƒ }  t j |  d ƒ t  d ƒ }  t j |  d ƒ t  d ƒ }  t j |  d ƒ t  d ƒ }  t j |  d ƒ d  S(	   Ns   /this is a test/for spaces/s#   /this%20is%20a%20test/for%20spaces/s   notebook with space.ipynbs   notebook%20with%20space.ipynbs%   /path with a/notebook and space.ipynbs-   /path%20with%20a/notebook%20and%20space.ipynbs,   / !@$#%^&* / test %^ notebook @#$ name.ipynbsT   /%20%21%40%24%23%25%5E%26%2A%20/%20test%20%25%5E%20notebook%20%40%23%24%20name.ipynb(   R   t   ntt   assert_equal(   t   path(    (    s8   lib/python2.7/site-packages/notebook/tests/test_utils.pyt   test_url_escape   s    	c          C   st   t  d ƒ }  t j |  d ƒ t  d ƒ }  t j |  d ƒ t  d ƒ }  t j |  d ƒ t  d ƒ }  t j |  d ƒ d  S(	   Ns#   /this%20is%20a%20test/for%20spaces/s   /this is a test/for spaces/s   notebook%20with%20space.ipynbs   notebook with space.ipynbs-   /path%20with%20a/notebook%20and%20space.ipynbs%   /path with a/notebook and space.ipynbsT   /%20%21%40%24%23%25%5E%26%2A%20/%20test%20%25%5E%20notebook%20%40%23%24%20name.ipynbs,   / !@$#%^&* / test %^ notebook @#$ name.ipynb(   R   R
   R   (   R   (    (    s8   lib/python2.7/site-packages/notebook/tests/test_utils.pyt   test_url_unescape)   s    	c       	   C   s±  t  ƒ  ¢}  t j j |  d ƒ } t j | ƒ t j t | |  ƒ t ƒ t j t	 | ƒ t ƒ t j j |  d ƒ } t j | ƒ t j t | |  ƒ t
 ƒ t j t	 | ƒ t
 ƒ t j t | | ƒ t ƒ t j j |  d d ƒ } t j | ƒ t j t | |  ƒ t
 ƒ t j t | ƒ t
 ƒ t j j |  d d ƒ } t j | ƒ t j t | |  ƒ t
 ƒ t j t | ƒ t
 ƒ t j t	 | ƒ t ƒ t j t	 | t j | ƒ ƒ t ƒ Wd  QXd  S(   Nt   subdirs   .subdir2t   subdir3s   .subdir4s   .subdir5t   subdir6(   R   t   osR   t   joint   makedirsR
   R   R   t   FalseR   t   Truet   stat(   t   roott   subdir1t   subdir2t   subdir34t   subdir56(    (    s8   lib/python2.7/site-packages/notebook/tests/test_utils.pyt   test_is_hidden:   s(    c          C   sž   t  ƒ   }  t |  ƒ }  t j j |  d ƒ } t j | ƒ t | |  ƒ sP t ‚ t j	 j
 j | d ƒ } | GHt | |  ƒ s‚ t ‚ t | ƒ s” t ‚ Wd  QXd  S(   Nu   subdiri   (   R   R   R   R   R   R   R   t   AssertionErrort   ctypest   windllt   kernel32t   SetFileAttributesWR   (   R   R   t   r(    (    s8   lib/python2.7/site-packages/notebook/tests/test_utils.pyt   test_is_hidden_win32T   s    (   t   __doc__R   R   t
   nose.toolst   toolsR
   t   traitlets.tests.utilsR    t   notebook.utilsR   R   R   R   t   ipython_genutils.py3compatR   t   ipython_genutils.tempdirR   t#   ipython_genutils.testing.decoratorsR   R	   R   R   R   R$   (    (    (    s8   lib/python2.7/site-packages/notebook/tests/test_utils.pyt   <module>   s   "				