U
    `»{j–  ã                   @   sh   d Z ddlZddlZddlmZ ddlZddlmZmZ ddlm	Z
 ddlmZmZ ejjd	d
„ ƒZdS )z;
Test the entire process of creating a Pooch and using it.
é    N)ÚPathé   )ÚcreateÚos_cache)Ú__version__é   )Úcheck_tiny_dataÚcapture_logc               
   C   s  t dƒ} |  ¡ rt t| ƒ¡ t| dtddd�}|j ¡ r>t‚| 	t
tj t¡ddƒ¡ dD ] }tƒ �(}| |¡}| ¡  ¡ d	 d
ksŠt‚W 5 Q R X t|ƒ t|ddd��}| d¡ W 5 Q R X tƒ �(}| |¡}| ¡  ¡ d	 dksêt‚W 5 Q R X t|ƒ q\dS )z(Fetch a data file from the local storagezpooch-testingz5https://github.com/fatiando/pooch/raw/{version}/data/ÚmainZPOOCH_DATA_DIR)ÚpathÚbase_urlÚversionZversion_devÚenvÚdatazregistry.txt)ztiny-data.txtzsubdir/tiny-data.txtr   ZDownloadingÚwzutf-8)ÚencodingzThe data is now differentZUpdatingN)r   ÚexistsÚshutilÚrmtreeÚstrr   Úfull_versionÚabspathÚAssertionErrorZload_registryr   Úosr   ÚdirnameÚ__file__r	   ÚfetchÚgetvalueÚsplitr   ÚopenÚwrite)r   ZpupÚtargetZlog_fileÚfnameZfin© r#   ú[/var/www/html/bwave/python/venv/lib/python3.8/site-packages/pooch/tests/test_integration.pyÚtest_create_and_fetch   s.    û
"
"r%   )Ú__doc__r   r   Úpathlibr   ZpytestÚ r   r   r   r   Úutilsr   r	   ÚmarkÚnetworkr%   r#   r#   r#   r$   Ú<module>   s   