Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/test_importlib/resources/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/test_importlib/resources/__pycache__/test_reader.cpython-312.pyc

�

)Μgt����ddlZddlZddlZddlZddlmZddlmZm	Z	Gd�dej�ZGd�dej�Ze
dk(rej�yy)	�N)�
import_module)�MultiplexedPath�NamespaceReaderc�d�eZdZed��Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zy)�MultiplexedPathTestc�p�tjt�jdz}t	|�|_y)N�namespacedata01)�pathlib�Path�__file__�parent�str�folder)�cls�paths  �F/usr/local/lib/python3.12/test/test_importlib/resources/test_reader.py�
setUpClasszMultiplexedPathTest.setUpClasss'���|�|�H�%�,�,�/@�@����Y��
�c�l�|jt�5t�ddd�y#1swYyxYw�N)�assertRaises�FileNotFoundErrorr��selfs r�test_init_no_pathsz&MultiplexedPathTest.test_init_no_pathss#��
�
�
�0�
1���2�
1�
1�s�*�3c��|jt�5ttjj|jd��ddd�y#1swYyxYw)N�binary.file)r�NotADirectoryErrorr�osr�joinrrs r�test_init_filez"MultiplexedPathTest.test_init_files8��
�
�
�1�
2��B�G�G�L�L����m�D�E�3�
2�
2�s�4A�Ac��t|j�j�D�chc]}|j��}}	|j	d�|j|hd��ycc}w#t
tf$rY�+wxYw)N�__pycache__>�
utf-8.filer�utf-16.file)rr�iterdir�name�remove�KeyError�
ValueError�assertEqual)rr�contentss   r�test_iterdirz MultiplexedPathTest.test_iterdirsq��*9�$�+�+�*F�*N�*N�*P�Q�*P�$�D�I�I�*P��Q�	��O�O�M�*�	
����#O�P��R���*�%�	��	�s�A"�A'�'A9�8A9c��tjjtjjtdd��}t|j|�j�D�chc]}|j��}}dD]}	|j|��|j|hd��ycc}w#ttf$rY�BwxYw)N�..�data01)r#z__init__.pyc>�__init__.py�subdirectoryr$rr%)
rr�abspathr rrrr&r'r(r)r*r+)rr0rr,r(s     r�test_iterdir_duplicatez*MultiplexedPathTest.test_iterdir_duplicate s�������������h��h�!G�H��"1�$�+�+�v�"F�"N�"N�"P�
�"P�$�D�I�I�"P�	�
�6�F�
�����'�6�
	
����W�	
��
���j�)�
��
�s�)B,�B1�1C�Cc�j�|jt|j�j�d�y)NT)r+rr�is_dirrs r�test_is_dirzMultiplexedPathTest.test_is_dir/s$���������5�<�<�>��Erc�j�|jt|j�j�d�y)NF)r+rr�is_filers r�test_is_filez MultiplexedPathTest.test_is_file2s$���������5�=�=�?��Grc��t|j�}|jt�5|j	�ddd�|jt�5|j�ddd�|jt�5|j
�ddd�y#1swY�fxYw#1swY�DxYw#1swYyxYwr)rrrr�
read_bytes�	read_text�open�rrs  r�test_open_filez"MultiplexedPathTest.test_open_file5s����t�{�{�+��
�
�
�0�
1��O�O��2�
�
�
�0�
1��N�N��2�
�
�
�0�
1��I�I�K�2�
1�	2�
1��
1�
1��
1�
1�s#�B!�B-�B9�!B*�-B6�9Cc�<�tjjtjjtd��}tjj|d�}t|j|�}|jt|jd��t|�dzdtjjdd��|jt|jd��t|�dzdtjjdd��|jt|jd��t|�dzdtjjdd��|j|j�|�y)Nr/r0r�r	r2�	imaginary)rrr3r rrrr+r�joinpath�len)r�prefixr0rs    r�test_join_pathz"MultiplexedPathTest.test_join_path>s(������������h��!=�>�������f�h�/���t�{�{�F�3�������
�
�m�,�-�c�&�k�A�o�.?�@��G�G�L�L�*�M�:�	
�	
�����
�
�n�-�.�s�6�{�Q��/@�A��G�G�L�L��>�2�	
�	
�����
�
�k�*�+�C��K�!�O�,=�>��G�G�L�L�*�K�8�	
�	
�������$�/rc�p�t|j�}|jd�j�rJ�y)Nzimaginary/foo.py)rrrD�existsr?s  r�test_join_path_compoundz+MultiplexedPathTest.test_join_path_compoundPs/���t�{�{�+���=�=�!3�4�;�;�=�=�=�=rc��tjjtjjtd��}tjj|d�}tjj|d�}t||�}|j
|jd�t
�|jt|jdd��t|�dzdtjjddd��y)Nr/r0�data02r2�	subsubdirrB)rrr3r rr�assertIsInstancerDr+rrE)rrFr0rLrs     r�test_join_path_common_subdirz0MultiplexedPathTest.test_join_path_common_subdirTs�������������h��!=�>�������f�h�/�������f�h�/���v�v�.�����d�m�m�N�;�_�M������
�
�n�k�:�;�C��K�!�O�<M�N��G�G�L�L��>�;�?�	
rc�|�|jtt|j��d|j�d��y)N�MultiplexedPath('�'))r+�reprrrrs r�	test_reprzMultiplexedPathTest.test_repr_s1����������-�.�����}�B�/�	
rc��|jt|j�jtj
j
|j��yr)r+rrr'rr�basenamers r�	test_namezMultiplexedPathTest.test_namees8������D�K�K�(�-�-��G�G���T�[�[�)�	
rN)�__name__�
__module__�__qualname__�classmethodrrr!r-r4r7r:r@rGrJrOrTrW�rrrr
sT�������F�Q�

�F�H��0�$>�	
�
�
rrc��eZdZeej
e�j�Ze	d��Z
e	d��Zd�Zd�Z
d�Zy)�NamespaceReaderTestc�V�tjj|j�yr)�sysr�append�site_dir�rs rrzNamespaceReaderTest.setUpClasso�����������%rc�V�tjj|j�yr)r`rr(rbrcs r�
tearDownClassz!NamespaceReaderTest.tearDownClasssrdrc�r�|jt�5tddg�ddd�y#1swYyxYw)N�path1�path2)rr*rrs r�test_init_errorz#NamespaceReaderTest.test_init_errorws)��
�
�
�z�
*��W�g�.�/�+�
*�
*�s�-�6c���td�}t|jj�}tj
j
tj
jtdd��}|j|jd�tj
j|d��|j|jd�tj
j|d��y)Nr	r/rrC)rr�__spec__�submodule_search_locationsrrr3r rr+�
resource_path�rr	�reader�roots    r�test_resource_pathz&NamespaceReaderTest.test_resource_path{s���'�(9�:�� ��!9�!9�!T�!T�U���w�w���r�w�w�|�|�H�d�<M�N�O������ � ��/������d�M�1R�	
�	
���� � ��-�r�w�w�|�|�D�+�/N�	
rc�~�td�}t|jj�}tj
j
tj
jtdd��}|j|j�t�|jt|j��d|�d��y)Nr	r/rQrR)rrrlrmrrr3r rrN�filesrr+rSros    r�
test_fileszNamespaceReaderTest.test_files�s���'�(9�:�� ��!9�!9�!T�!T�U���w�w���r�w�w�|�|�H�d�<M�N�O�����f�l�l�n�o�>�����f�l�l�n�-�1B�4�&��/K�LrN)rXrYrZrr
rrr
rbr[rrfrjrrrur\rrr^r^lsS���<�7�<�<��)�0�0�1�H��&��&��&��&�0�

�Mrr^�__main__)�os.pathrr`r
�unittest�	importlibr�importlib.readersrr�TestCaserr^rX�mainr\rr�<module>r}s[���
���#�>�_
�(�+�+�_
�D M�(�+�+� M�F�z���H�M�M�O�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists