
    Owg
                        d Z ddlmZ ddlZddlmZ ddlmZ ej                  j                  d      Zd Zd Zej                  j                  dd	d
gddgg      d        Zej                  j                  dddgddgg      d        Zy)z]
Tests the usecols functionality during parsing
for all of the parsers defined in parsers.py
    )StringION)	DataFramez=ignore:Passing a BlockManager to DataFrame:DeprecationWarningc                     d}| }ddddddddd	}t        |      }|j                  t        |      d
dg      }t        j                  ||       y )NPAAA,BBB,CCC,DDD
0.056674973,8,True,a
2.613230982,2,False,b
3.568935038,7,False,a?$@r.-@r            r      )AAABBBr   r   usecolsr   read_csvr   tmassert_frame_equalall_parsersdataparserexp_dataexpectedresults         b/var/www/horilla/myenv/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/test_strings.py!test_usecols_with_unicode_stringsr      si    D F $!!

 q!H "H__Xd^eU^_DF&(+    c                     d}| }ddddddddd	}t        |      }|j                  t        |      d
dg      }t        j                  ||       y )NzHA,B,C,D
0.056674973,8,True,a
2.613230982,2,False,b
3.568935038,7,False,ar   r   r	   r
   r   r   r   )ABr"   r#   r   r   r   s         r   -test_usecols_with_single_byte_unicode_stringsr$   '   si    D F $!!

 qQH "H__Xd^c3Z_@F&(+r    r   r   s   BBBs   AAAr   c                     d}| }d}t        j                  t        |      5  |j                  t	        |      |       d d d        y # 1 sw Y   y xY w)Nr   z['usecols' must either be list-like of all strings, all unicode, all integers or a callable.)matchr   )pytestraises
ValueErrorr   r   )r   r   r   r   _msg_validate_usecols_args        r   (test_usecols_with_mixed_encoding_stringsr+   =   sT    D F	" 
 
z)B	C 989 9 9s   AA	   あああ   いいc                     d}| }ddddddddd	}t        |      }|j                  t        |      |
      }t        j                  ||       y )Nuh   あああ,いい,ううう,ええええ
0.056674973,8,True,a
2.613230982,2,False,b
3.568935038,7,False,ar   r   r	   r
   r   r   r   )r,   r-   r   r   )r   r   r   r   r   r   r   s          r   'test_usecols_with_multi_byte_charactersr/   M   se    D F $!!

 A!$H "H__Xd^W_=F&(+r    )__doc__ior   r'   pandasr   pandas._testing_testingr   markfilterwarnings
pytestmarkr   r$   parametrizer+   r/    r    r   <module>r:      s       [[''C

,,,, eV_vuo$FG9 H9 k8%<{H>U$VW, X,r    