U
    ½mœdß  ã                   @   s^   d Z ddlZddlZejjejjdk p2ej ¡ j	 dd�ejj
gZdd„ Zdd	„ Zd
d„ ZdS )z9
    Read-only S3 virtual file driver (VFD) test module.
é    N)é   é
   é   zros3 driver not available)Úreasonc               	   C   sJ   t jdddd��0} | st‚d|  ¡ ks*t‚| d jdks<t‚W 5 Q R X dS )z ROS3 driver and options z3https://dandiarchive.s3.amazonaws.com/ros3test.hdf5ÚrÚros3©ÚdriverÚ	mydataset©éd   N©Úh5pyÚFileÚAssertionErrorÚkeysÚshape©Úf© r   úM/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/h5py/tests/test_ros3.pyÚ	test_ros3   s    ÿr   c                	   C   sX   t jtdd�� tjdddd� W 5 Q R X t jtdd�� tjdddd� W 5 Q R X d	S )
z"ROS3 exceptions for s3:// locationz&AWS region required for s3:// location)Úmatchzs3://fakebucket/fakekeyr   r   r   z0^foo://wrong/scheme: S3 location must begin withzfoo://wrong/schemeN)ÚpytestZraisesÚ
ValueErrorr   r   r   r   r   r   Útest_ros3_s3_fails#   s    r   c               	   C   sL   t jddddd��0} | st‚d|  ¡ ks,t‚| d jdks>t‚W 5 Q R X dS )	zUse S3 URI with ROS3 driverzs3://dandiarchive/ros3test.hdf5r   r   s	   us-east-2)r	   Z
aws_regionr
   r   Nr   r   r   r   r   Útest_ros3_s3uri,   s    
ÿr   )Ú__doc__r   r   ÚmarkZskipifÚversionZhdf5_version_tupleZh5Z
get_configr   Z	nonetworkZ
pytestmarkr   r   r   r   r   r   r   Ú<module>
   s   þü
	