o
    :ήc                     @   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J |t	t
jtdd dD ]l}t }||}|  d	 d
ksEJ W d   n1 sOw   Y  t| t|d}|d W d   n1 smw   Y  t }||}|  d	 dksJ W d   n1 sw   Y  t| q.dS )z(Fetch a data file from the local storagezpooch-testingz5https://github.com/fatiando/pooch/raw/{version}/data/mainPOOCH_DATA_DIR)pathbase_urlversionversion_devenvdatazregistry.txt)ztiny-data.txtzsubdir/tiny-data.txtr   DownloadingNwzThe data is now differentUpdating)r   existsshutilrmtreestrr   full_versionabspathload_registryr   osr   dirname__file__r	   fetchgetvaluesplitr   openwrite)r   puptargetlog_filefnamefin r)   C/tmp/pip-target-vg8gfxp4/lib/python/pooch/tests/test_integration.pytest_create_and_fetch   s6   


r+   )__doc__r   r   pathlibr   pytest r   r   r   r   utilsr   r	   marknetworkr+   r)   r)   r)   r*   <module>   s   