
    Pi(                         d dl Z d dlZd dlZd dlZd dlmZ d dl	m
Z
 d dlmZ  ej        d          Zej        d             Zd Zd Zd Zej                            d	g d
          d             ZdS )    N)	ExcelFile)inspect_excel_formatxlrdc                      dS )z
    Valid extensions for reading Excel files with xlrd.

    Similar to read_ext, but excludes .ods, .xlsb, and for xlrd>2 .xlsx, .xlsm
    z.xls r       s/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/pandas/tests/io/excel/test_xlrd.pyread_ext_xlrdr
      s	     6r   c                 h   d}d} |dddd          }t                               |          5 }t          ||          5 }t          j        ||d	          }d d d            n# 1 swxY w Y   t          j        |||d
          }d d d            n# 1 swxY w Y   t          j        ||           d S )Nr   Sheet1iodataexcelz	test1.xlsenginer   )
sheet_name	index_col)r   r   r   )r   open_workbookr   pd
read_exceltmassert_frame_equal)	r
   datapathr   r   pthbookxlresultexpecteds	            r	   test_read_xlrd_bookr      sN   FJ
(4+
6
6C			C	 	  
DtF+++ 	Kr]2*JJJF	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K =Z!
 
 
	
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 &(+++++s4   BA#B#A'	'B*A'	+BBBc                     ddl m}  | dddd          }t          j        |d          5  t	          j        |d	
           d d d            d S # 1 swxY w Y   d S )Nr   )	XLRDErrorr   r   r   z
test1.xlsxzExcel xlsx file; not supported)matchr   r   )
xlrd.biffhr!   pytestraisesr   r   )r   r!   paths      r	   test_read_xlsx_failsr'   '   s    $$$$$$8D&'<88D	y(H	I	I	I + +
d6****+ + + + + + + + + + + + + + + + + +s   AAAc                 $    | dddd          }t          j        t          j        d                             d          t          j        dt          j        f         d          }t          j        |d 	          }t          j        ||           d S )
Nr   r   r   z	test6.xls)r      int64   )r   r+   )header)	r   	DataFramenpr_astypenanr   r   r   )r   r&   r   r   s       r	   test_nan_in_xlsr2   0   s|    8D&';77D|d 2 27 ; ;ai@PQQRRH]4---F&(+++++r   file_header)s   	    s   	    s   	    s   ࡱc                 X    t          j        |           }t          |          dk    sJ d S )Nxls)r   BytesIOr   )r3   fs     r	   test_read_old_xls_filesr8   ;   s2     	
;A""e++++++r   )r   numpyr.   r$   pandasr   pandas._testing_testingr   pandas.io.excelr   pandas.io.excel._baser   importorskipr   fixturer
   r   r'   r2   markparametrizer8   r   r   r	   <module>rC      s   				                % % % % % % 6 6 6 6 6 6v6""   , , ,+ + +, , ,    , , , , ,r   