U
    sVc                     @   s6   d dl Z d dlmZmZ d dlmZ G dd dZdS )    N)	DataFrameSeriesc                   @   s$   e Zd Zdd Zdd Zdd ZdS )TestPipec                 C   s`   t ddddgi}t ddddgi}|tkr<|d }|d }dd }||d}t|| d S )	NA            	   c                 S   s   | | S N xyr   r   H/tmp/pip-unpacked-wheel-xj8nt62q/pandas/tests/frame/methods/test_pipe.py<lambda>       z$TestPipe.test_pipe.<locals>.<lambda>)r   r   pipetmassert_equal)selfframe_or_seriesobjexpectedfresultr   r   r   	test_pipe   s    zTestPipe.test_pipec                 C   sF   t ddddgi}t||}dd }||dfd}t|| d S )	Nr   r   r   r   c                 S   s   |S r   r   r   r   r   r   r      r   z*TestPipe.test_pipe_tuple.<locals>.<lambda>r   r   )r   r   get_objr   r   )r   r   r   r   r   r   r   r   test_pipe_tuple   s
    zTestPipe.test_pipe_tuplec              	   C   s\   t ddddgi}t||}dd }d}tjt|d |j|d	fdd
d W 5 Q R X d S )Nr   r   r   r   c                 S   s   |S r   r   r   r   r   r   r   "   r   z0TestPipe.test_pipe_tuple_error.<locals>.<lambda>z0y is both the pipe target and a keyword argument)matchr   r   r   )r   r   r   pytestZraises
ValueErrorr   )r   r   r   r   msgr   r   r   test_pipe_tuple_error   s    zTestPipe.test_pipe_tuple_errorN)__name__
__module____qualname__r   r   r#   r   r   r   r   r   
   s   r   )r    Zpandasr   r   Zpandas._testingZ_testingr   r   r   r   r   r   <module>   s   