
    bMh                     6   d dl Z d dlZd dlZd dlm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            rej        j        Z ej        dg          d             Zd	 Zd
 Zd Zej                            dg d          d             ZdS )    N)is_platform_windows)	ExcelFile)inspect_excel_formatxlrdz.xls)paramsc                     | j         S )z
    Valid extensions for reading Excel files with xlrd.

    Similar to read_ext, but excludes .ods, .xlsb, and for xlrd>2 .xlsx, .xlsm
    )param)requests    _/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pandas/tests/io/excel/test_xlrd.pyread_ext_xlrdr      s     =    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_xlsr5   5   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   )r6   fs     r   test_read_old_xls_filesr;   @   s2     	
;A""e++++++r   )r   numpyr1   r'   pandas.compatr   pandasr   pandas._testing_testingr   pandas.io.excelr   pandas.io.excel._baser   importorskipr   mark
single_cpu
pytestmarkfixturer   r"   r*   r5   parametrizer;    r   r   <module>rJ      sJ   				      - - - - - -           % % % % % % 6 6 6 6 6 6v6"" ('J x     ! , , ,+ + +, , ,    , , , , ,r   