a
    Gb                     @   s:   d dl Zd dlmZmZmZ d dlmZ G dd dZ	dS )    N)Index	Timedeltatimedelta_rangec                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
TestJoinc                 C   sF   t ddd}tg d}||}t|d ts4J |j|dd d S )Nz1 days
   Zperiods)abcdr   outerZhow)r   r   append
isinstancer   join)selfrngidxresult r   Hlib/python3.9/site-packages/pandas/tests/indexes/timedeltas/test_join.py!test_append_join_nondatetimeindex   s
    
z*TestJoin.test_append_join_nondatetimeindexc                 C   s*   t ddd}|j||d}t|| d S )N1 dayr   r   r   )r   r   tmassert_index_equal)r   Z	join_typeindexjoinedr   r   r   test_join_self   s    zTestJoin.test_join_selfc                 C   sr   t jdddd ddd}t| |jj|jdd}||j}|jtd	ksRJ |j|jksbJ t || d S )
Nr   c                  _   s
   t j S )N)npZrandomZrandn)argskwargsr   r   r   <lambda>       z>TestJoin.test_does_not_convert_mixed_integer.<locals>.<lambda>iZtd)Z
data_gen_fZ
r_idx_typeZ
c_idx_typer   r   O)	r   ZmakeCustomDataframestrcolumnsr   r   Zdtyper   r   )r   ZdfZcolsr   r   r   r   #test_does_not_convert_mixed_integer   s    z,TestJoin.test_does_not_convert_mixed_integerc                 C   s   t ddd}|d d j|dd  dd}|j|jks:J t|| |d d j|dd  dd}|jd u srJ |d}t|| d S )Nr   r   r      r   r      )r   r   Zfreqr   r   delete)r   Ztdir   Zexpectedr   r   r   test_join_preserves_freq+   s    
z!TestJoin.test_join_preserves_freqN)__name__
__module____qualname__r   r   r'   r+   r   r   r   r   r      s   
r   )
Znumpyr   Zpandasr   r   r   Zpandas._testingZ_testingr   r   r   r   r   r   <module>   s   