o
    i e,                     @   sZ   d dl mZ ddlZddlZeejjdkdG dd dej	Z
edkr+e  dS dS )	   )ut    N)   	      zVDS requires HDF5 >= 1.9.233c                   @   s   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd  Zd!d" Zd#d$ Zd%S )&TestVirtualSourcec                 C   s<   t ddd}|d d d d d d f }| |j|j d S )Ntest      r   h5VirtualSourceassertEqualshapeselfdatasetsliced r   V/var/www/myenv/lib/python3.10/site-packages/h5py/tests/test_vds/test_virtual_source.pytest_full_slice	   s   z!TestVirtualSource.test_full_slicec                 C   s6   t ddd}|dd d d d f }| d|j d S Nr   r	      )r   r   r   r   r   r   r   test_integer_indexed   s   z&TestVirtualSource.test_integer_indexedc                 C   s(   t ddd}|d }| d|j d S r   r   r   r   r   r   test_integer_single_indexed   s   z-TestVirtualSource.test_integer_single_indexedc                 C   s2   t ddd}|dd d df }| d|j d S )Nr   r	   r   
   r   r   r   r   r   r   test_two_integer_indexed"   s   z*TestVirtualSource.test_two_integer_indexedc                 C   sH   t ddd}|ddd d d d f }| d|jdd   |j d S )Nr   r	   r   r   )r   r   r   r   r   r   r   test_single_range'   s    z#TestVirtualSource.test_single_rangec                 C   st   t ddd}g }tdD ]"}|dd| d jd }tddd| d j}|||k q| dt	| d S )	Nr   r
   r   r         r   r
   )
r   r   ranger   nparangesizeappendr   sum)r   r   cmpidrefr   r   r   $test_shape_calculation_positive_step,   s   z6TestVirtualSource.test_shape_calculation_positive_stepc                 C   s:   t ddd}|ddd d ddf }| d|j d S )Nr   r	   r   r   r
      )r   r   r   r   r   r   r   r   test_double_rangeR   s   z#TestVirtualSource.test_double_rangec                 C   s>   t ddd}|dddd d dddf }| d	|j d S )
Nr   r	      r!   r   r
      r"   )r"   r   r   r   r   r   r   r   test_double_strided_rangeW   s   z+TestVirtualSource.test_double_strided_rangec                 C   ,   t ddd}|dd }| d|j d S )Nr   r	      r0   r   r   r   r   r   r   r   test_negative_start_indexa      z+TestVirtualSource.test_negative_start_indexc                 C   r3   )Nr   r	   r   r6   r   r   r   r   r   test_negative_stop_indexf   r8   z*TestVirtualSource.test_negative_stop_indexc                 C   r3   )Nr   r	   r4   r9   r6   r   r   r   r   r   "test_negative_start_and_stop_indexk   r8   z4TestVirtualSource.test_negative_start_and_stop_indexc                 C   s*   t ddd}|d }| |j|j d S )Nr   r	   .r   r   r   r   r   test_ellipsisu   s   zTestVirtualSource.test_ellipsisc                 C   s>   t ddd}|dddf }| d|jdd   |j d S )Nr   r	   r   r   .r   r   r   r   r   r   test_ellipsis_endz       z#TestVirtualSource.test_ellipsis_endc                 C   s>   t ddd}|dddf }| |jd d d |j d S )Nr   r	   .r   r   r=   r   r   r   r   r   test_ellipsis_start   r?   z%TestVirtualSource.test_ellipsis_startc                 C   sH   t ddd}|dddddf }| d|jdd	  d |j d S )
Nr   )r
   r   r   (   r   r   .r   r0   r=   r@   r   r   r   r   r   test_ellipsis_sandwich   s   $z(TestVirtualSource.test_ellipsis_sandwichc                 C   s    t ddd}| |jd d S )Nr   r
   r    r   r   r   r   r   r   test_integer_shape   s   z$TestVirtualSource.test_integer_shapec                 C   s$   t jddddd}| |jd d S )Nr   r
   r   maxshaper   )r   r   r   rG   rD   r   r   r   test_integer_maxshape   s   z'TestVirtualSource.test_integer_maxshapec              	   C   s:  t jddddd}g d|d< |d }| t t |d W d    n1 s*w   Y  | t t j|d	d
 W d    n1 sFw   Y  | t t j|dd W d    n1 sbw   Y  | t t j|td W d    n1 s~w   Y  W d    d S W d    d S 1 sw   Y  d S )Nf1coreFw)namedriverbacking_storemode)r   r   r"   abr=   )r   )NrF   )dtype)r   FileassertRaises	TypeErrorr   int)r   ftestrP   r   r   r   test_extra_args   s*   "z!TestVirtualSource.test_extra_argsN)__name__
__module____qualname__r   r   r   r   r   r-   r/   r2   r7   r:   r;   r<   r>   rA   rC   rE   rH   rX   r   r   r   r   r      s&    &

r   __main__)commonr   h5pyr   numpyr$   
skipUnlessversionhdf5_version_tupleTestCaser   rY   mainr   r   r   r   <module>   s     