
    j2                        d Z ddlZddlmZ ddlZej                            ej                                        j	         d          gZ
ej        j        ej                            d ej        i dej                            ej        j        dk    d	          
           ej        ddidej                            ej        j        dk     d          
          g          d                         Zej                            d ej        eddgdej                            ej        j        dk    d	          
           ej        eddgdej                            ej        j        dk     d          
          g          d             Zej        j        d             Zej                            ej        j        dk     d          d             ZdS )z9
    Read-only S3 virtual file driver (VFD) test module.
    N)	make_faplzros3 driver not available)reasonkwargszHDF5-v1)   r   r   zRequires HDF5 < 2.0)idmarks
aws_region	   us-east-2zHDF5-v2zRequires HDF5 >= 2.0c                     t          j        dddi| 5 }|sJ d|                                v sJ |d         j        dk    sJ 	 ddd           dS # 1 swxY w Y   dS )	z ROS3 driver and options 3https://dandiarchive.s3.amazonaws.com/ros3test.hdf5rdriverros3	mydatasetd   N)r   r   h5pyFilekeysshape)r   fs     W/var/www/html/Carbon-Document/venv/lib/python3.11/site-packages/h5py/tests/test_ros3.py	test_ros3r      s    2 
 
, 
, 
,$*
, 
, ./0qaffhh&&&&~#v-----	. . . . . . . . . . . . . . . . . .s   0AAAzexc,match_excz&AWS region required for s3:// locationz0^foo://wrong/scheme: S3 location must begin withz can't parse object key from pathc                 4   t          j        | |d                   5  t          j        ddd           ddd           n# 1 swxY w Y   t          j        | |d                   5  t          j        d	dd           ddd           dS # 1 swxY w Y   dS )
z"ROS3 exceptions for s3:// locationr   )matchzs3://fakebucket/fakekeyr   r   )r   N   zfoo://wrong/scheme)pytestraisesr   r   )exc	match_excs     r   test_ros3_s3_failsr"   :   s2   8 
s)A,	/	/	/ A A	+S@@@@A A A A A A A A A A A A A A A 
s)A,	/	/	/ < <	&F;;;;< < < < < < < < < < < < < < < < < <s#   AAA(BBBc                      t          j        dddd          5 } | sJ d|                                 v sJ | d         j        dk    sJ 	 ddd           dS # 1 swxY w Y   dS )	zUse S3 URI with ROS3 driverzs3://dandiarchive/ros3test.hdf5r   r   r
   )r   r	   r   r   Nr   )r   s    r   test_ros3_s3urir$   ]   s     
4c&*
, 
, 
, ./0qaffhh&&&&~#v-----	. . . . . . . . . . . . . . . . . .s   0AAA)r      r   z-AWS S3 access token support in HDF5 >= 1.14.2c                  ~    d} t          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fapls     r   test_ros3_temp_tokenr6   g   sf     &EVDd!4tSW"&ARS%)@ @ @D ,,$**,,,,5,,    )__doc__r   h5py._hl.filesr   r   markskipifh5
get_configr   
pytestmarknetworkparametrizeparamversionhdf5_version_tupler   
ValueErrorOSErrorr"   r$   r6    r7   r   <module>rG      s     $ $ $ $ $ $  KG  %%*  , ,
 +$$/9<, %  	
 	
 	
 	<(+$$/);- %  	
 	
 	
 *. .+  ,. 8C +$$/9<, %  	
 	
 	
 	56+$$/);- %  		
 	
 	
 4< <5 4< . . . DL3j@J  L L- -L L- - -r7   