관리-도구
편집 파일: pytest_plugin_test.cpython-311.pyc
� �܋fL � �p � d Z ddlZddlZddlmZ ddlmZ ddlZd� Z d� Z d� Zd� Zd � Z d � Zd� Zd� Zd � ZdS )z?Tests that the pytest plugin properly provides the "fs" fixture� N)�OSType)�Pausec �r � | � d� � t j � d� � sJ �d S �N�/var/data/xx1.txt��create_file�os�path�exists��fss �y/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pyfakefs/pytest_tests/pytest_plugin_test.py�test_fs_fixturer s6 � ��N�N�&�'�'�'� �7�>�>�-�.�.�.�.�.�.�.� c �r � | � d� � t j � d� � sJ �d S r r )�fake_filesystems r �test_fs_fixture_aliasr s8 � ���� 3�4�4�4� �7�>�>�-�.�.�.�.�.�.�.r c �� � |� d� � | � d� � t j � d� � sJ �t j � d� � sJ �| |k sJ �d S )Nr z/var/data/xx2.txtr )r r s r �test_both_fixturesr sw � ���� 3�4�4�4��N�N�&�'�'�'� �7�>�>�-�.�.�.�.�.� �7�>�>�-�.�.�.�.�.� �� � � � � � r c �� � t j � � }| � |j � � sJ �t j � |j � � sJ �| � � � | � |j � � sJ �t j � |j � � rJ �t j � � }| � |j � � rJ �t j � |j � � sJ �| � � � t j � |j � � rJ �t j � |j � � sJ �d S �N)�tempfile�NamedTemporaryFiler �namer r �pause�resume�r �fake_temp_file�real_temp_files r �test_pause_resumer! s � ��0�2�2�N� �9�9�^�(�)�)�)�)�)� �7�>�>�.�-�.�.�.�.�.��H�H�J�J�J� �9�9�^�(�)�)�)�)�)��w�~�~�n�1�2�2�2�2�2��0�2�2�N��y�y��,�-�-�-�-�-� �7�>�>�.�-�.�.�.�.�.��I�I�K�K�K��w�~�~�n�1�2�2�2�2�2� �7�>�>�.�-�.�.�.�.�.�.�.r c �� � t j � � }| � |j � � sJ �t j � |j � � sJ �t | � � 5 | � |j � � sJ �t j � |j � � rJ �t j � � }| � |j � � rJ �t j � |j � � sJ � d d d � � n# 1 swxY w Y t j � |j � � rJ �t j � |j � � sJ �d S r )r r r r r r r r s r � test_pause_resume_contextmanagerr# + sl � ��0�2�2�N� �9�9�^�(�)�)�)�)�)� �7�>�>�.�-�.�.�.�.�.� �r��� 3� 3��y�y��,�-�-�-�-�-��7�>�>�.�"5�6�6�6�6�6�!�4�6�6���9�9�^�0�1�1�1�1�1��w�~�~�n�1�2�2�2�2�2�2�3� 3� 3� 3� 3� 3� 3� 3� 3� 3� 3���� 3� 3� 3� 3� �w�~�~�n�1�2�2�2�2�2� �7�>�>�.�-�.�.�.�.�.�.�.s �%BD � D�Dc � � d}t |d� � 5 }|� d� � d d d � � n# 1 swxY w Y t j j � |� � }|� � � dk sJ �d S )Nzfoo.txt�w�bar)�open�write�pyfakefs�pytest_tests�io�InputStream�read)r �filepath�f�streams r �test_use_own_io_moduler1 9 s� � ��H� �h�� � � �� �������� � � � � � � � � � ���� � � � � � "� %� 1� 1�(� ;� ;�F��;�;�=�=�E�!�!�!�!�!�!s �5�9�9c � � t j | _ t j � t j � � � � sJ �d S r )r �WINDOWSr r r r � gettempdirr s r �test_switch_to_windowsr5 B s4 � ��N�B�E� �7�>�>�(�-�/�/�0�0�0�0�0�0�0r c � � t j | _ t j � t j � � � � sJ �d S r )r �LINUXr r r r r4 r s r �test_switch_to_linuxr8 G �4 � ��L�B�E� �7�>�>�(�-�/�/�0�0�0�0�0�0�0r c � � t j | _ t j � t j � � � � sJ �d S r )r �MACOSr r r r r4 r s r �test_switch_to_macosr<