
    Owg"                     H    d Z ddlZddlmZmZ ddlmZ  G d de      Z	d Z
y)z)
Tests involving custom Index subclasses
    N)	DataFrameIndexc                       e Zd ZddZy)CustomIndexNc                     t        d |D              rt        d      |t        |d      r|j                  }t	        j
                  |d      }| j                  ||      S )Nc              3   <   K   | ]  }t        |t                y wN)
isinstancestr).0vals     Y/var/www/horilla/myenv/lib/python3.12/site-packages/pandas/tests/indexes/test_subclass.py	<genexpr>z&CustomIndex.__new__.<locals>.<genexpr>   s     4z#s#4s   zCustomIndex cannot hold stringsnameOdtype)any	TypeErrorhasattrr   nparray_simple_new)clsdatar   s      r   __new__zCustomIndex.__new__   sT    4t44=>><GD&199DxxC(tT**    r	   )__name__
__module____qualname__r    r   r   r   r      s    	+r   r   c                     t        g d      } | j                  dd      }t        g dt              }t	        j
                  ||       t        t        j                  j                  d      j                  d      | t        ddgd	      
      }|j                         }t	        j
                  |j                  |       y )N)         r   string)r&   r#   r$   r%   r   r$   )r$   r%   r#   )r   )columnsindex)r   insertr   objecttmassert_index_equalr   r   randomdefault_rngstandard_normalreset_indexr'   )idxresultexpecteddfs       r   "test_insert_fallback_to_base_indexr5      s     i
 CZZ8$F(7H&(+	
		a 008QF*
B
 ^^F&..(3r   )__doc__numpyr   pandasr   r   pandas._testing_testingr+   r   r5   r!   r   r   <module>r;      s*     
+% 
+4r   