Your IP : 216.73.216.213


Current Path : /opt/alt/python39/lib64/python3.9/test/test_importlib/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/test/test_importlib/__pycache__/test_open.cpython-39.pyc

a

XC?h��@s�ddlZddlmZddlmZddlmZGdd�dejej�ZGdd	�d	ejej�Z	Gd
d�d�Z
Gdd
�d
e
ej�ZGdd�de
ejej�Z
edkr�e��dS)�N)�	resources�)�data01)�utilc@seZdZdd�ZdS)�CommonBinaryTestscCs0t�||��Wd�n1s"0YdS�N)r�open_binary��self�package�path�r
�B/opt/alt/python39/lib64/python3.9/test/test_importlib/test_open.py�execute	szCommonBinaryTests.executeN��__name__�
__module__�__qualname__rr
r
r
rrsrc@seZdZdd�ZdS)�CommonTextTestscCs0t�||��Wd�n1s"0YdSr)r�	open_textr	r
r
rrszCommonTextTests.executeNrr
r
r
rrsrc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�	OpenTestscCsFt�|jd��$}|��}|�|d�Wd�n1s80YdS)Nzbinary.files)rr�data�read�assertEqual�r
�fp�resultr
r
r�test_open_binaryszOpenTests.test_open_binarycCsFt�|jd��$}|��}|�|d�Wd�n1s80YdS)Nz
utf-8.filezHello, UTF-8 world!
�rrrrrrr
r
r�test_open_text_default_encodingsz)OpenTests.test_open_text_default_encodingcCsJt�|jddd��}|��}Wd�n1s00Y|�|d�dS)N�utf-16.filezutf-16�strictzHello, UTF-16 world!
rrr
r
r�test_open_text_given_encodings
�&z'OpenTests.test_open_text_given_encodingcCs�t�|jddd��}|�t|j�Wd�n1s60Yt�|jddd��}|��}Wd�n1sp0Y|�|d�dS)Nr zutf-8r!�ignorez*Hello, UTF-16 world!
)rrr�assertRaises�UnicodeErrorrrrr
r
r�test_open_text_with_errors%s
�,
�&�z$OpenTests.test_open_text_with_errorscCs|�ttj|jd�dS�Nzdoes-not-exist)r$�FileNotFoundErrorrrr�r
r
r
r�"test_open_binary_FileNotFoundError3s
�z,OpenTests.test_open_binary_FileNotFoundErrorcCs|�ttj|jd�dSr')r$r(rrrr)r
r
r� test_open_text_FileNotFoundError8s
�z*OpenTests.test_open_text_FileNotFoundErrorN)	rrrrrr"r&r*r+r
r
r
rrsrc@seZdZdd�ZdS)�
OpenDiskTestscCs
t|_dSr)rrr)r
r
r�setUp?szOpenDiskTests.setUpN)rrrr-r
r
r
rr,>sr,c@seZdZdS)�OpenZipTestsN)rrrr
r
r
rr.Csr.�__main__)Zunittest�	importlibr�rrZCommonResourceTestsZTestCaserrrr,ZZipSetupr.r�mainr
r
r
r�<module>s*