o
    5c                     @   s>   d dl Zd dlZd dlmZmZ d dlmZ G dd dZ	dS )    N)Index
MultiIndexc                   @   s~   e Zd Zejddedgdd Zejdddgddggdd	 Z	d
d Z
dd Zejddgddggdd ZdS )TestIndexConstructorvalue   c                 C   sH   d| d}t jt|d t| W d    d S 1 sw   Y  d S )Nz?Index\(\.\.\.\) must be called with a collection of some kind, z was passedmatch)pytestraises	TypeErrorr   )selfr   msg r   g/var/www/html/gps/gps/lib/python3.10/site-packages/pandas/tests/indexes/base_class/test_constructors.pytest_constructor_corner   s   
"z,TestIndexConstructor.test_constructor_corner
index_vals)Ar   Bc                 C   s(   t |}t|t sJ t|trJ d S N)r   
isinstancer   )r   r   indexr   r   r   #test_construction_list_mixed_tuples   s   z8TestIndexConstructor.test_construction_list_mixed_tuplesc              	   C   sz   t jtdd, tt tg dd W d    n1 sw   Y  W d    d S W d    d S 1 s6w   Y  d S )Nz$Unexpected keyword arguments {'foo'}r   bar)foo)r	   r
   r   tmassert_produces_warningFutureWarningr   )r   r   r   r   test_constructor_wrong_kwargs!   s   "z2TestIndexConstructor.test_constructor_wrong_kwargsc                 C   sH   d}t jt|d tg dtd W d    d S 1 sw   Y  d S )Nz!could not convert string to floatr   )abc)dtype)r	   r
   
ValueErrorr   float)r   r   r   r   r   test_constructor_cast'   s   "z*TestIndexConstructor.test_constructor_cast
tuple_listr   c                 C   s"   t |}t|}t|| d S r   )r   r   from_tuplesr   assert_index_equal)r   r%   resultexpectedr   r   r   test_construct_empty_tuples,   s   
z0TestIndexConstructor.test_construct_empty_tuplesN)__name__
__module____qualname__r	   markparametrizenpint64r   r   r   r$   r*   r   r   r   r   r      s    
	
r   )
numpyr0   r	   pandasr   r   pandas._testing_testingr   r   r   r   r   r   <module>   s
    