관리-도구
편집 파일: patched_packages_test.cpython-311.pyc
� �܋f � � � d Z ddlZddlZddlZddlmZ ddlmZ ddlZ n # e $ r dZ Y nw xY w ddlZn # e $ r dZY nw xY w ddlZn # e $ r dZY nw xY w ej eo ej dk d� � G d� dej � � � � ZdS ) zY Provides patches for some commonly used modules that enable them to work with pyfakefs. � N)�fake_filesystem_unittest)�IS_PYPY)� � z&Has a problem with older PyPy versionsc �H � e Zd Zd� Ze�d� Zd� Ze�e�d� Ze�e �d� Z dS dS dS )�TestPatchedPackagesc �. � | � � � d S )N)� setUpPyfakefs)�selfs �u/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pyfakefs/tests/patched_packages_test.py�setUpzTestPatchedPackages.setUp, s � ��������� Nc � � d}| j � |d�� � t j |� � }|j g d�k � � � sJ �d S )N�/foo/bar.csvz1,2,3,4��contents��1�2�3�4)�fs�create_file�pd�read_csv�columns�all�r �path�dfs r � test_read_csvz!TestPatchedPackages.test_read_csv1 s] � �!�D��G����y��9�9�9���T�"�"�B��J�"6�"6�"6�6�;�;�=�=�=�=�=�=�=r c � � d}| j � |d�� � t j |d�� � }|j g d�k � � � sJ �d S )Nr z1|2|3|4r �|)� delimiterr )r r r � read_tabler r r s r �test_read_tablez#TestPatchedPackages.test_read_table7 sb � �!�D��G����y��9�9�9���t�s�3�3�3�B��J�"6�"6�"6�6�;�;�=�=�=�=�=�=�=r c �p � d}t j � t j � t � � � � }t j � |dd� � }| j � ||�� � t j |� � }|j g d�k � � � sJ �d S )N� /foo/bar.xlsx�fixtureszexcel_test.xlsx)�target_path)� � r � )�osr �dirname�abspath�__file__�joinr � add_real_filer � read_excelr r )r r �src_pathr s r �test_read_excelz#TestPatchedPackages.test_read_excel? s� � �"�D��w���r�w���x�'@�'@�A�A�H��w�|�|�H�j�:K�L�L�H� �G�!�!�(��!�=�=�=���t�$�$�B��J�,�,�,�.�3�3�5�5�5�5�5�5�5r c �X � | j � d� � d}t j g d�g� � }t j |� � 5 }|� |� � d d d � � n# 1 swxY w Y t j |� � }|j g d�k � � � sJ �d S )Nz/foor( )r r+ r, r )z Unnamed: 0r r+ r, r ) r � create_dirr � DataFrame�ExcelWriter�to_excelr4 r r )r r r �writers r �test_write_excelz$TestPatchedPackages.test_write_excelK s� � ��G���v�&�&�&�"�D���|�|�|�n�-�-�B����%�%� $�����F�#�#�#� $� $� $� $� $� $� $� $� $� $� $���� $� $� $� $���t�$�$�B��J�"<�"<�"<�<�A�A�C�C�C�C�C�C�Cs �A*�*A.�1A.)�__name__� __module__�__qualname__r r r! r&