Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/__pycache__/test_zipimport_support.cpython-312.opt-1.pyc

�

'ΜgE*��,�ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlmZddl
mZmZmZmZmZej&j(ZddlmZmZmZmZd�ZGd�dej6�Zd�Zed	k(rej>�yy)
�N)�	os_helper)�spawn_python�kill_python�assert_python_ok�make_script�make_zip_script)�test_doctest�sample_doctest�sample_doctest_no_doctests�sample_doctest_no_docstringsc���tjtd��}tjt��}	|j�d|j
��}|j|||�D]}|j|��|j|j}}|r$tjjd||fz��trtd|j|fz�||fS#t$r|j}Y��wxYw)NF)�verbose�recurse)r�.z%d of %d doctests failedz,doctest (%s) ... %d tests with zero failures)�doctest�
DocTestFinderr�
DocTestRunner�
__module__�__qualname__�AttributeError�__name__�find�run�failures�tries�test�support�
TestFailed�print)�obj�module�finder�runner�name�example�f�ts        �8/usr/local/lib/python3.12/test/test_zipimport_support.py�_run_object_doctestr)%s���
�
"�
"�7�E�
B�F�
�
"�
"�7�
3�F���.�.�#�*:�*:�;���;�;�s�D�&�1���
�
�7��2��?�?�F�L�L�q�A���l�l�%�%�&@�A�q�6�&I�J�J��
�=����RS�@T�T�U��a�4�K���������s�C�C5�4C5c�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�ZipSupportTestsc�4�tj�tjj	�t
jdd|_t
jdd|_t
jdd|_t
jj	�y�N)
�	linecache�
clearcache�	zipimport�_zip_directory_cache�clear�sys�path�	meta_path�
path_hooks�path_importer_cache��selfs r(�setUpzZipSupportTests.setUpBsa�������&�&�,�,�.��H�H�Q�K��	����q�)����.�.��+������%�%�'�c���|jtjdd|jtjdd|jtjddtjj�yr-)r4r3r5r6r7r2r8s r(�tearDownzZipSupportTests.tearDownJsI���i�i�������>�>��
�
�a�� �O�O����q�����%�%�'r;c�2�d}tj�5}t|d|�}tjjdtjj
|��}t|d||�\}}tj|�tjjd|�ddl}	|jtj|j�|�tj d=	ddd�y#tj d=wxYw#1swYyxYw)Nzdef foo(): pass
�__init__�zip_pkg�test_zipr)r�temp_dirr�osr4�join�basenamer�remover3�insertr@�assertEqual�inspect�	getsource�foo�modules)r9�test_src�d�	init_name�name_in_zip�zip_name�run_namer@s        r(� test_inspect_getsource_issue4223z0ZipSupportTests.test_inspect_getsource_issue4223Ps���&��
�
�
�
!�Q�#�A�z�8�<�I��'�'�,�,�y�')�w�w�'7�'7�	�'B�D�K�!0��J�09�;�"H��H�h��I�I�i� ��H�H�O�O�A�x�(��
+�� � ��!2�!2�7�;�;�!?��J��K�K�	�*�"�
!���K�K�	�*��"�
!�s$�BD
�-/C7�D
�7D
�
D
�
Dc�F�tjt�}|jdd�}|jdd�}|jdd�}i}tt
tfD]^}tj|�}|jdd�}|jjd�d}|jd	d
�}|||<�`tj�5}t|d|�}t|d|�\}}	tj|d�5}
|j�D]\}}|
j!|d
z|��	ddd�t"r=tj|d�5}t%d|z�|j'�ddd�t)j*|�t,j.j1d|�ddl}	|j4|j4j6|j4j6j8|j4j8|j4j:|j4j<|j4j>|j4j@|j4jB|jD|jDj8|jDj@|jDjB|jF|jH|jJ|jLjN|jLjP|jLjR|jLjT|jLjV|jX|jZ|j\|j^|j`|jbg}
|jd|jf|jhg}|
D]}tk||��	t,jld=	ddd�y#1swY���xYw#1swY��xxYw#t,jld=wxYw#1swYyxYw)Nz*from test.test_doctest import test_doctestz*import test_zipped_doctest as test_doctestztest.test_doctest.test_doctest�test_zipped_doctestz test.test_doctest.sample_doctest�sample_zipped_doctestr����sample_�sample_zipped_rA�az.py�rzContents of %r:r)7rIrJr	�replacer
rrr�splitrrBrr�zipfile�ZipFile�items�writestrrr�printdirrCrFr3r4rGrU�SampleClass�NestedClassr?�
a_classmethod�
a_property�a_staticmethod�double�get�SampleNewStyleClass�sample_func�test_DocTest�test_DocTestParser�test_DocTestRunner�basics�
exceptions�option_directives�optionflags�verbose_flag�test_Example�
test_debug�test_testsource�test_trailing_space_in_test�test_DocTestSuite�test_DocTestFinder�test_DocFileSuite�
test_testfile�test_unittest_reportflagsr)rL)r9rM�sample_sources�mod�src�mod_namerN�script_namerQrR�z�zip_filerU�known_good_tests�fail_due_to_missing_data_filesr s                r(�test_doctest_issue4197z&ZipSupportTests.test_doctest_issue4197`s����$�$�\�2���#�#�E�E�G���#�#�$D�$9�;���#�#�$F�$;�=����"�$>�0�2�C��#�#�C�(�C��+�+�>�@U�V�C��|�|�)�)�#�.�r�2�H��'�'�	�3C�D�H�'*�N�8�$�2��
�
�
!�Q�%�a�)>�,4�6�K�!0��J�0;�"=��H�h�����3�/�1�%3�%9�%9�%;�M�H�c��J�J�x�%�/��5�&<�0���_�_�X�s�3�x��,�x�7�8��%�%�'�4�
�I�I�k�"��H�H�O�O�A�x�(�&�0
7�(�3�3�'�3�3�?�?�'�3�3�?�?�H�H�'�3�3�<�<�'�3�3�A�A�'�3�3�>�>�'�3�3�B�B�'�3�3�:�:�'�3�3�7�7�'�;�;�'�;�;�D�D�'�;�;�B�B�'�;�;�?�?�'�3�3�'�4�4�'�:�:�'�:�:�A�A�'�:�:�E�E�'�:�:�L�L�'�:�:�F�F�'�:�:�G�G�'�4�4�'�2�2�'�7�7�'�C�C�'�9�9�'�:�:�7$� �@(�9�9�'�5�5�'�A�A�2�.�,�C�'��-@�A�,��K�K� 5�6�"�
!�
0�/��4�3��l�K�K� 5�6��"�
!�sV�4P�.O'�;$P�O4�>AP�HP�P�'O1	�,P�4O>	�9P�P�P�P c�`�tjd�}d}tj�5}t	|d|�}t|�\}}}||dfz}tr+td|�td�tt|��|j|jd�|�t|d|d	�\}	}
t|	�\}}}||
dfz}tr+td|�td�tt|��|j|jd�|�ddd�y#1swYyxYw)
Nz�                    class Test:
                        ">>> 'line 2'"
                        pass

                    import doctest
                    doctest.testmod()
                    zFile "%s", line 2, in %s�scriptz
__main__.Testz
Expected linezGot stdout:�utf-8rA�__main__.py)�textwrap�dedentrrBrrrr�ascii�assertIn�encoder)r9rM�patternrNr��rc�out�err�expectedrQrRs           r(�test_doctest_main_issue4197z+ZipSupportTests.test_doctest_main_issue4197�s���?�?�$���-��
�
�
�
!�Q�%�a��8�<�K�+�K�8�L�B��S��+��!?�?�H�����1��}�%��u�S�z�"��M�M�(�/�/�'�2�C�8�!0��J�0;�]�"L��H�h�+�H�5�L�B��S��(�O�!<�<�H�����1��}�%��u�S�z�"��M�M�(�/�/�'�2�C�8�#"�
!�
!�s�C/D$�$D-c�x�tjd�}tj�5}t	|d|�}t|�}|jjd�t|�}|jtjj|jd��|�t|d|d�\}}t|�}|jjd�t|�}|jtjj|jd��|�ddd�y#1swYyxYw)Nz�                    def f():
                        pass

                    import pdb
                    pdb.Pdb(nosigint=True).runcall(f)
                    r�sl
r�rAr�)r�r�rrBrr�stdin�writerr�rCr4�normcaser�r)r9rMrNr��p�datarQrRs        r(�test_pdb_issue4201z"ZipSupportTests.test_pdb_issue4201�s����?�?�$����
�
�
!�Q�%�a��8�<�K��[�)�A�
�G�G�M�M�&�!��q�>�D��M�M�"�'�'�*�*�;�+=�+=�g�+F�G��N�!0��J�0;�]�"L��H�h��X�&�A�
�G�G�M�M�&�!��q�>�D��M�M�"�'�'�*�*�8�?�?�7�+C�D�d�K�"�
!�
!�s�C=D0�0D9N)	rrrr:r=rSr�r�r��r;r(r+r+9s#��(�(�+� Y7�v9�:Lr;r+c�@�tjj�yr-)rr�
reap_childrenr�r;r(�tearDownModuler��s���L�L��� r;�__main__) �test.supportrrC�os.pathr3r�r^r0rrIr.�unittestr�test.support.script_helperrrrrrrr�test.test_doctestr	r
rrr)�TestCaser+r�r�mainr�r;r(�<module>r�s���
�	��
��������"�F�F��,�,�
�
��=�=�
�(tL�h�'�'�tL�n!��z���H�M�M�O�r;

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