o
    5c                     @   s>   d dl Zd dlmZmZmZmZ d dlmZ	 G dd dZ
dS )    N)CategoricalCategoricalIndexIndexIntervalc                   @   sD   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S )TestReindexc                 C   s   t g d}tjtdd |ddg\}}W d    n1 s!w   Y  tj|tg ddd t|tj	g d	tj
d
 d S )Nabcr   
non-uniquematchr   r
   r   r   r
   Texactr         dtype)r   tmassert_produces_warningFutureWarningreindexassert_index_equalr   assert_numpy_array_equalnparrayintp)selfciresindexer r#   c/var/www/html/gps/gps/lib/python3.10/site-packages/pandas/tests/indexes/categorical/test_reindex.pytest_reindex_list_non_unique   s    z(TestReindex.test_reindex_list_non_uniquec                 C   s   t g d}tjtdd |tddg\}}W d    n1 s#w   Y  t g dddgd}tj||dd	 t|tj	g d
tj
d d S )Nr   r   r   r   r
   r   
categoriesTr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   expr#   r#   r$   #test_reindex_categorical_non_unique   s    z/TestReindex.test_reindex_categorical_non_uniquec                 C   s   t g dg dd}tjtdd |ddg\}}W d    n1 s%w   Y  tg dd	d
}tj||dd t|tj	g dtj
d
 d S )Nr   r   r	   r
   dr&   r   r   r   r
   r   objectr   Tr   r   )r   r   r   r   r   r   r   r   r   r   r   r)   r#   r#   r$   ,test_reindex_list_non_unique_unused_category   s    z8TestReindex.test_reindex_list_non_unique_unused_categoryc                 C   s   t g dg dd}tjtdd |tddg\}}W d    n1 s'w   Y  t g dddgd}tj||d	d
 t|tj	g dtj
d d S )Nr   r,   r&   r   r   r   r
   r   Tr   r   r   r(   r)   r#   r#   r$   3test_reindex_categorical_non_unique_unused_category'   s    z?TestReindex.test_reindex_categorical_non_unique_unused_categoryc                 C   s   t g dg dd}|g d\}}tg ddd}tj||dd t|tjg d	tjd |t g dg dd\}}t g dg dd}tj||dd t|tjg d	tjd d S )
N)r   r	   r
   r,   r&   )r   r
   r
   r.   r   Tr   )r   r   r   )	r   r   r   r   r   r   r   r   r   )r   catr!   r"   r*   r#   r#   r$   test_reindex_duplicate_target/   s    z)TestReindex.test_reindex_duplicate_targetc                 C   sR   t g }|ddg\}}tj|tddgdd t|tjddgtjd d S )Nr   r	   Tr   r   )	r   r   r   r   r   r   r   r   r   )r   r
   r!   r"   r#   r#   r$   test_reindex_empty_index>   s    z$TestReindex.test_reindex_empty_indexc              	   C   s   t tddddtddddgdd}t tddddtddddtddddtdd	ddgdd}||\}}|}t|| d S )
Nr      right)closedr   T)orderedr      )r   r   r   r   r   )r   r    ci_addresult_expectedr#   r#   r$   'test_reindex_categorical_added_categoryE   s   	z3TestReindex.test_reindex_categorical_added_categoryN)
__name__
__module____qualname__r%   r+   r/   r0   r2   r4   r>   r#   r#   r#   r$   r      s    		r   )numpyr   pandasr   r   r   r   pandas._testing_testingr   r   r#   r#   r#   r$   <module>   s    