HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/test/test_importlib/__pycache__/test_open.cpython-311.pyc
�

��VcW
��b�ddlZddlmZddlmZddlmZGd�dejej��ZGd�d	ejej��Z	Gd
�d��Z
Gd�d
e
ej��ZGd�de
ej��ZGd�de
ej
ej��Zedkrej��dSdS)�N)�	resources�)�data01)�utilc��eZdZd�ZdS)�CommonBinaryTestsc��tj|���|��}|�d��5	ddd��dS#1swxYwYdS)N�rb�r�files�joinpath�open��self�package�path�targets    �1D:\Python311\Lib\test\test_importlib\test_open.py�executezCommonBinaryTests.execute	s������)�)�2�2�4�8�8��
�[�[��
�
�	�	��	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A�A�AN��__name__�
__module__�__qualname__r��rrr�#����������rrc��eZdZd�ZdS)�CommonTextTestsc��tj|���|��}|���5	ddd��dS#1swxYwYdS�Nrrs    rrzCommonTextTests.executes������)�)�2�2�4�8�8��
�[�[�]�]�	�	��	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A�A�ANrrrrrrrrrc�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�	OpenTestsc���tj|j��dz}|�d��5}|���}|�|d��ddd��dS#1swxYwYdS)Nzbinary.filer
s�rr�datar�read�assertEqual�rr�fp�results    r�test_open_binaryzOpenTests.test_open_binarys�������+�+�m�;��
�[�[��
�
�	:�"��W�W�Y�Y�F����V�%8�9�9�9�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:����	:�	:�	:�	:�	:�	:s�+A*�*A.�1A.c���tj|j��dz}|���5}|���}|�|d��ddd��dS#1swxYwYdS)Nz
utf-8.filezHello, UTF-8 world!
r$r(s    r�test_open_text_default_encodingz)OpenTests.test_open_text_default_encodings�������+�+�l�:��
�[�[�]�]�	>�b��W�W�Y�Y�F����V�%<�=�=�=�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>����	>�	>�	>�	>�	>�	>s�+A)�)A-�0A-c���tj|j��dz}|�dd���5}|���}ddd��n#1swxYwY|�|d��dS)N�utf-16.filezutf-16�strict��encoding�errorszHello, UTF-16 world!
r$r(s    r�test_open_text_given_encodingz'OpenTests.test_open_text_given_encoding#s�������+�+�m�;��
�[�[�(�8�[�
<�
<�	���W�W�Y�Y�F�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�����!9�:�:�:�:�:s�A�A�Ac��tj|j��dz}|�dd���5}|�t
|j��ddd��n#1swxYwY|�dd���5}|���}ddd��n#1swxYwY|�|d��dS)Nr/zutf-8r0r1�ignorez*Hello, UTF-16 world!
)rrr%r�assertRaises�UnicodeErrorr&r'r(s    r�test_open_text_with_errorsz$OpenTests.test_open_text_with_errors)s7������+�+�m�;��
�[�[�'�(�[�
;�
;�	5�r����l�B�G�4�4�4�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5����	5�	5�	5�	5�
�[�[�'�(�[�
;�
;�	�r��W�W�Y�Y�F�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�����
7�	
�	
�	
�	
�	
s#�!A!�!A%�(A%�B$�$B(�+B(c��tj|j��dz}|�t|jd��dS)N�does-not-existr
�rrr%r7�FileNotFoundErrorr�rrs  r�"test_open_binary_FileNotFoundErrorz,OpenTests.test_open_binary_FileNotFoundError7s:������+�+�.>�>�����+�V�[�$�?�?�?�?�?rc�~�tj|j��dz}|�t|j��dS)Nr;r<r>s  r� test_open_text_FileNotFoundErrorz*OpenTests.test_open_text_FileNotFoundError;s8������+�+�.>�>�����+�V�[�9�9�9�9�9rN)	rrrr+r-r4r9r?rArrrr"r"sq������:�:�:�>�>�>�;�;�;�
�
�
�@�@�@�:�:�:�:�:rr"c��eZdZd�ZdS)�
OpenDiskTestsc��t|_dSr )rr%)rs r�setUpzOpenDiskTests.setUpAs
����	�	�	rN�rrrrErrrrCrC@s#����������rrCc��eZdZd�ZdS)�OpenDiskNamespaceTestsc� �ddlm}||_dS)Nr)�namespacedata01)�rJr%)rrJs  rrEzOpenDiskNamespaceTests.setUpFs��%�%�%�%�%�%�#��	�	�	rNrFrrrrHrHEs#������$�$�$�$�$rrHc��eZdZdS)�OpenZipTestsN)rrrrrrrMrMLs�������DrrM�__main__)�unittest�	importlibrrKrr�CommonTests�TestCaserrr"rCrH�ZipSetuprMr�mainrrr�<module>rUs�������������������������������(�(�*;���������d�&��(9����':�':�':�':�':�':�':�':�T�����I�x�0����
$�$�$�$�$�Y��(9�$�$�$�	�	�	�	�	�9�d�m�X�->�	�	�	��z����H�M�O�O�O�O�O��r