B
    3¢\¶  ã               @   s˜   d Z ddlZddlZddlm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d	„ Zd
d„ Zdd„ Zdd„ Zedd„ ƒZdS )zTest HTML utilsé    N)Úcheck_help_all_output)Ú
url_escapeÚurl_unescapeÚ	is_hiddenÚis_file_hidden)Úcast_unicode)ÚTemporaryDirectory)Úskip_if_not_win32c               C   s   t dƒ dS )z!jupyter notebook --help-all worksZnotebookN)r   © r
   r
   ú8lib/python3.7/site-packages/notebook/tests/test_utils.pyÚtest_help_output   s    r   c              C   sT   t dƒ} t | d¡ t dƒ} t | d¡ t dƒ} t | d¡ t dƒ} t | d¡ d S )	Nz/this is a test/for spaces/z#/this%20is%20a%20test/for%20spaces/znotebook with space.ipynbznotebook%20with%20space.ipynbz%/path with a/notebook and space.ipynbz-/path%20with%20a/notebook%20and%20space.ipynbz,/ !@$#%^&* / test %^ notebook @#$ name.ipynbzT/%20%21%40%24%23%25%5E%26%2A%20/%20test%20%25%5E%20notebook%20%40%23%24%20name.ipynb)r   ÚntÚassert_equal)Úpathr
   r
   r   Útest_url_escape   s    r   c              C   sT   t dƒ} t | d¡ t dƒ} t | d¡ t dƒ} t | d¡ t dƒ} t | d¡ d S )	Nz#/this%20is%20a%20test/for%20spaces/z/this is a test/for spaces/znotebook%20with%20space.ipynbznotebook with space.ipynbz-/path%20with%20a/notebook%20and%20space.ipynbz%/path with a/notebook and space.ipynbzT/%20%21%40%24%23%25%5E%26%2A%20/%20test%20%25%5E%20notebook%20%40%23%24%20name.ipynbz,/ !@$#%^&* / test %^ notebook @#$ name.ipynb)r   r   r   )r   r
   r
   r   Útest_url_unescape)   s    r   c           	   C   s>  t ƒ ,} tj | d¡}t |¡ t t|| ƒd¡ t t|ƒd¡ tj | d¡}t |¡ t t|| ƒd¡ t t|ƒd¡ t t||ƒd¡ tj | dd¡}t |¡ t t|| ƒd¡ t t|ƒd¡ tj | dd¡}t |¡ t t|| ƒd¡ t t|ƒd¡ t t|ƒd¡ t t|t 	|¡ƒd¡ W d Q R X d S )	NÚsubdirFz.subdir2TZsubdir3z.subdir4z.subdir5Zsubdir6)
r   Úosr   ÚjoinÚmakedirsr   r   r   r   Ústat)ÚrootÚsubdir1Zsubdir2Zsubdir34Zsubdir56r
   r
   r   Útest_is_hidden:   s(    




r   c           	   C   sv   t ƒ f} t| ƒ} tj | d¡}t |¡ t|| ƒr6t‚tj	j
 |d¡}t|ƒ t|| ƒs\t‚t|ƒsht‚W d Q R X d S )Nr   é   )r   r   r   r   r   r   r   ÚAssertionErrorÚctypesZwindllZkernel32ZSetFileAttributesWÚprintr   )r   r   Úrr
   r
   r   Útest_is_hidden_win32T   s    
r   )Ú__doc__r   r   Z
nose.toolsZtoolsr   Ztraitlets.tests.utilsr   Znotebook.utilsr   r   r   r   Zipython_genutils.py3compatr   Zipython_genutils.tempdirr   Z#ipython_genutils.testing.decoratorsr	   r   r   r   r   r   r
   r
   r
   r   Ú<module>   s   