U
    sVc[                     @   s6   d Z ddlZddlmZmZmZmZ G dd dZdS )z\
Series.item method, mainly testing that we get python scalars as opposed to
numpy scalars.
    N)Series	Timedelta	Timestamp
date_rangec                   @   s   e Zd Zdd ZdS )TestItemc              	   C   s  t dg}| }|dkst||jd ks0tt|ts>tt dgdgd}| }t|tsdt|dksptt ddg}d}tjt	|d |  W 5 Q R X t
d	dd
}tjt	|d |  W 5 Q R X tjt	|d t |  W 5 Q R X |d d  }t|tstt |d d  }t|ts:t|| }tjt	|d |  W 5 Q R X tjt	|d t |  W 5 Q R X |d d  }t|tstt |d d  }t|tstt |ddgd}|jd d  }||d kstd S )N   r   g      ?   )index   z#can only convert an array of size 1)matchz
2016-01-01)Zperiods      )r   itemAssertionErrorZiloc
isinstanceintfloatpytestZraises
ValueErrorr   r   r   )selfZserresultmsgZdtivalZtdi r   I/tmp/pip-unpacked-wheel-xj8nt62q/pandas/tests/series/methods/test_item.py	test_item   sD    
zTestItem.test_itemN)__name__
__module____qualname__r   r   r   r   r   r      s   r   )__doc__r   Zpandasr   r   r   r   r   r   r   r   r   <module>   s   