PATH:
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
pyfakefs
/
tests
/
__pycache__
� "��y��� � � d Z ddlZddlZddlZddlZddlmZ G d� dej � � Ze dk r ej � � dS dS )zTests that ensure that the `tempfile` module works with `fake_filesystem` if using `Patcher` (via `fake_filesystem_unittest`). � N)�fake_filesystem_unittestc �H � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd � ZdS )�FakeTempfileModuleTestz5Test the 'tempfile' module with the fake file system.c �. � | � � � d S �N)� setUpPyfakefs)�selfs �s/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pyfakefs/tests/fake_tempfile_test.py�setUpzFakeTempfileModuleTest.setUp s � ��������� c �\ � t j � � }| � | j � |j � � � � |� � � | � t � � 5 | j � |j � � d d d � � d S # 1 swxY w Y d S r ) �tempfile�NamedTemporaryFile� assertTrue�fs� get_object�name�close�assertRaises�OSError)r �objs r �test_named_temporary_filez0FakeTempfileModuleTest.test_named_temporary_file! s� � ��)�+�+�������*�*�3�8�4�4�5�5�5�� � ���� � � �w� '� '� )� )��G���s�x�(�(�(� )� )� )� )� )� )� )� )� )� )� )� )���� )� )� )� )� )� )s �4 B!�!B%�(B%c �� � t j d�� � }|� d� � |� � � | j � |j � � }|j }| � d|� � t j ddd�� � }|� d� � |� � � | j � |j � � }| � d|j � � d S )NF)�deletes foo�foo�w�utf8)�mode�encodingr ) r r �writer r r r �contents�assertEqual)r r �file_objr! s r �#test_named_temporary_file_no_deletez:FakeTempfileModuleTest.test_named_temporary_file_no_delete( s� � ��)��7�7�7��� � �&����� � �����7�%�%�c�h�/�/���$�������)�)�)��)�s�V�E�R�R�R��� � �%����� � �����7�%�%�c�h�/�/������� 1�2�2�2�2�2r c �: � t | j j � � }t j � � }| � dt |� � � � | � |d � t j � t j � � d� � � � � � | � ||d � � | � | j � |d � � � � | j j rdnd}| � | j � |d � � j t j |z � � t j |d d� � }| � |d |� � � � � d S )N� � �tmpr � � zw+b)�lenr � open_filesr �mkstempr"