U
    sVc                     @   sf   d dl Z d dlZd dlZd dlZd dlmZ e	d ej
dddd Zdd Zd	d
 Zdd ZdS )    NodfT)Zautousec                 C   s4   t jtjdd}| td| | |ddd d S )Nr   )Zengine
read_exceliodataexcel)	functoolspartialpdr   setattrchdir)Zmonkeypatchdatapathfunc r   B/tmp/pip-unpacked-wheel-xj8nt62q/pandas/tests/io/excel/test_odf.pycd_and_set_engine   s    r   c                	   C   s(   t jtdd td W 5 Q R X d S )Nz"Unrecognized type awesome_new_type)matchzinvalid_value_type.ods)pytestZraises
ValueErrorr	   r   r   r   r   r   test_read_invalid_types_raises   s    r   c                  C   sh   t jdddgdd} t jdtjdgdtjd	gd
tjdgg| dddgd}t jdddd}t|| d S )NzRow 1zRow 2zRow 3Header)name               	   Column 1z
Unnamed: 2Column 3)indexcolumnszwritertable.odtZTable1r   )Z
sheet_nameZ	index_col)r	   ZIndex	DataFramenpnanr   tmassert_frame_equal)r   expectedresultr   r   r   test_read_writer_table   s     r(   c                  C   sJ   t jdddgtjtjdgdddggdd	d
gd} t d}t||  d S )Ng      ?g      @r   r   g      @g      @r   r   zColumn 2r   )r    ztest_newlines.ods)r	   r!   r"   r#   r   r$   r%   )r&   r'   r   r   r   -test_read_newlines_between_xml_elements_table)   s    
r)   )r   Znumpyr"   r   Zpandasr	   Zpandas._testingZ_testingr$   ZimportorskipZfixturer   r   r(   r)   r   r   r   r   <module>   s   


