U
    sVcD	                     @   sH   d dl Zd dlZd dlmZ d dlmZ d dlm	Z	 G dd de	Z
dS )    N)IntervalIndex)Basec                   @   sl   e Zd ZdZeZejedddZejdd Z	ddd	d
Z
dd Zdd Zdd Zdd Zdd ZdS )TestBasez
    Tests specific to the shared common index tests; unrelated tests should be placed
    in test_interval.py or the specific test file (e.g. test_astype.py)
    )returnc                 C   s   | j jtdddS )N   rightclosed)
_index_clsfrom_breaksrangeself r   K/tmp/pip-unpacked-wheel-xj8nt62q/pandas/tests/indexes/interval/test_base.pysimple_index   s    zTestBase.simple_indexc                 C   s
   t dS )N
   )tmZmakeIntervalIndexr   r   r   r   index   s    zTestBase.indexr   r   c                C   s   t jtd|dS )Nr   r   )r   r   r   )r   r	   r   r   r   create_index   s    zTestBase.create_indexc                 C   s   d S Nr   r   r   r   r   test_repr_max_seq_item_setting   s    z'TestBase.test_repr_max_seq_item_settingc                 C   s   d S r   r   r   r   r   r   test_repr_roundtrip    s    zTestBase.test_repr_roundtripc                 C   sb   | j |d}|td}t|| |dddg}tjdddgdddg|d}t|| d S )Nr   r   r         )r   Ztaker   r   assert_index_equalr   Zfrom_arrays)r   r	   r   resultexpectedr   r   r   	test_take$   s    zTestBase.test_takec                 C   s   |}|}dgt | }|}|||}t|| dgdgt |dd    }ttjg|dd    }|||}t|| d S )NTFr   )lenwherer   r   r   npnantolist)r   r   Zlistlike_boxklassidxZcondr   r   r   r   r   
test_where.   s    zTestBase.test_wherec              
   C   s   |}t jtdd, tt |d d d f  W 5 Q R X W 5 Q R X t jtdd |d  W 5 Q R X t jtdd |d  W 5 Q R X d S )Nz&multi-dimensional indexing not allowed)matchTF)pytestZraises
ValueErrorr   Zassert_produces_warningFutureWarning)r   r   r%   r   r   r   test_getitem_2d_deprecated<   s    $z#TestBase.test_getitem_2d_deprecatedN)__name__
__module____qualname____doc__r   r
   r(   Zfixturer   r   r   r   r   r   r&   r+   r   r   r   r   r   	   s   

r   )Znumpyr!   r(   Zpandasr   Zpandas._testingZ_testingr   Zpandas.tests.indexes.commonr   r   r   r   r   r   <module>   s
   