3
���h> � @ s� d Z ddlmZ ddlZddlZddljjZ ddl
Zddlj
ZddlmZmZ ejd�Zeej�Zejjd�ZeejjG dd� d���ZdS ) z test feather-format compat � )�LooseVersionN)�read_feather�
to_feather�pyarrowzignore:The Sparsec @ s� e Zd Zdd� Zdi fdd�Zdd� Zdd � Zd
d� Zdd
� Zdd� Z e
jddd�dd� �Zdd� Z
dd� Zdd� Zdd� Zdd� Ze
jddd�d d!� �Ze
jd�ejd"d#� ��ZdS )$�TestFeatherc C s8 t j|��$ tj� �}t||� W d Q R X W d Q R X d S )N)�pytestZraises�tm�ensure_cleanr )�self�df�exc�path� r �>/tmp/pip-build-5_djhm0z/pandas/pandas/tests/io/test_feather.py�check_error_on_write s
z TestFeather.check_error_on_writeNc
K sJ |d kr|}t j� �,}t||f|� t|f|�}t j||� W d Q R X d S )N)r r r r �assert_frame_equal)r
r �expected�write_kwargsZread_kwargsr
�resultr r r �check_round_trip s
zTestFeather.check_round_tripc C sF x@t jdddg�ddt jd�tjdddg�gD ]}| j|t� q.W d S )N� � � �foo�20130101)�pdZSeries� Timestamp�np�arrayr �
ValueError)r
�objr r r �
test_error+ s zTestFeather.test_errorc C s" t jtd�ttdd��tjdd�jd�tjddd d
�dtjdgdd
dgdtjd
gt jtd��t j tt j
ddd��d d�t j tt j
dddd��d d�t jd�t jt jd�gt j tt j
dddd��d d�d��}t
td�kr�t jdddd�|d< |