U
    sVc}                     @   sF   d dl Zd dlZd dlmZmZmZ dd Zdd ZG dd dZ	dS )	    N)is_scalar_indexerlength_of_indexervalidate_indicesc                  C   s.   t jdtd} d| d< t| }|dks*td S )N   )Zdtype   r   )npzerosboolr   AssertionError)Zarrresult r   G/tmp/pip-unpacked-wheel-xj8nt62q/pandas/tests/indexing/test_indexers.pytest_length_of_indexer   s    r   c                  C   s   d} t | dstt | d dr$ttdgdf} t | drBttdgtdgf} t | drhttdgtddgf} t | drtt td drtd} t | dstd} t | dstd S )N)r   r      r   r      r   )r   )r   r
   r   arrayslice)Zindexerr   r   r   test_is_scalar_indexer   s    r   c                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
TestValidateIndicesc                 C   sB   t ddg}t|d t|d d d tt ddgd d S )Nr   r   r   )r   asarrayr   r   selfindicesr   r   r   test_validate_indices_ok+   s    
z,TestValidateIndices.test_validate_indices_okc              	   C   s6   t ddg}tjtdd t|d W 5 Q R X d S )Nr   z'indices' containsmatchr   )r   r   pytestraises
ValueErrorr   r   r   r   r   test_validate_indices_low1   s    z-TestValidateIndices.test_validate_indices_lowc              	   C   s8   t dddg}tjtdd t|d W 5 Q R X d S )Nr   r   r   indices are outr   )r   r   r   r   
IndexErrorr   r   r   r   r   test_validate_indices_high6   s    z.TestValidateIndices.test_validate_indices_highc              	   C   s2   t jtdd ttddgd W 5 Q R X d S )Nr"   r   r   r   )r   r   r#   r   r   r   )r   r   r   r   test_validate_indices_empty;   s    z/TestValidateIndices.test_validate_indices_emptyN)__name__
__module____qualname__r   r!   r$   r%   r   r   r   r   r   *   s   r   )
Znumpyr   r   Zpandas.core.indexersr   r   r   r   r   r   r   r   r   r   <module>   s
   