o
    biy                     @   s   d Z ddlZddlmZ ddlZejjejjdk pej	
 j ddgZejjdd Zd	d
 Zejjdd Zejjejjdk dddd ZdS )z9
    Read-only S3 virtual file driver (VFD) test module.
    N)	make_fapl)   
      zros3 driver not available)reasonc                  C   s`   t jdddd} | sJ d|  v sJ | d jdksJ W d   dS 1 s)w   Y  dS )z ROS3 driver and options z3https://dandiarchive.s3.amazonaws.com/ros3test.hdf5rros3driver	mydatasetd   Nh5pyFilekeysshapef r   H/home/ubuntu/.local/lib/python3.10/site-packages/h5py/tests/test_ros3.py	test_ros3   s   "r   c                   C   s   t jtdd tjdddd W d   n1 sw   Y  t jtdd tjd	ddd W d   dS 1 s:w   Y  dS )
z"ROS3 exceptions for s3:// locationz&AWS region required for s3:// location)matchzs3://fakebucket/fakekeyr   r   r	   Nz0^foo://wrong/scheme: S3 location must begin withzfoo://wrong/scheme)pytestraises
ValueErrorr   r   r   r   r   r   test_ros3_s3_fails%   s   "r   c                  C   sb   t jddddd} | sJ d|  v sJ | d jdksJ W d   dS 1 s*w   Y  dS )	zUse S3 URI with ROS3 driverzs3://dandiarchive/ros3test.hdf5r   r   s	   us-east-2)r
   
aws_regionr   r   Nr   r   r   r   r   test_ros3_s3uri.   s   
"r   )r         z-AWS S3 access token support in HDF5 >= 1.14.2c                  C   s:   d} t dddddddddddd| d}| sJ | dS )zSet and get S3 access tokens   #0123FakeToken4567/8/9r   Nr   )libverrdcc_nslotsrdcc_nbytesrdcc_w0lockingpage_buf_sizemin_meta_keepmin_raw_keepalignment_thresholdalignment_intervalmeta_block_sizesession_token)r   get_fapl_ros3_token)tokenfaplr   r   r   test_ros3_temp_token8   s   
r0   )__doc__r   h5py._hl.filesr   r   markskipifversionhdf5_version_tupleh5
get_configr   
pytestmark	nonetworkr   r   r   r0   r   r   r   r   <module>   s$   	

	
	