404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.137.174.253: ~ $
�

�܋f���r�ddlZddlmZddlZddlZddlZddlmZddlmZddl	m
Z
Gd�de
��ZdS)�N)�StringIO)�mock)�Loader)�TestCasec�|�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	e
jded	����d
���Z
dS)�
TestLoaderzTests for tap.loader.Loaderc�p�tjd��}tjd���}|�|�d����|���t��}|�|j	��}|�
dt|j����dS)zThe loader handles a file.z�TAP version 13
            1..2
            # This is a diagnostic.
            ok 1 A passing test
            not ok 2 A failing test
            This is an unknown line.
            Bail out! This test would abort.
            F��delete�utf-8�N)
�inspect�cleandoc�tempfile�NamedTemporaryFile�write�encode�closer�load_suite_from_file�name�assertEqual�len�_tests��self�sample�temp�loader�suites     �f/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/tap/tests/test_loader.py�test_handles_filezTestLoader.test_handles_files����!�
�	
�	
���*�%�8�8�8���
�
�6�=�=��)�)�*�*�*��
�
���������+�+�D�I�6�6��	
����C���-�-�.�.�.�.�.�c��t��}|�d��}|�dt|j����|�d�d���|jdjj��dS)z8The loader records a failure when a file does not exist.z	phony.tap�z{filename} does not exist.)�filenamerN)rrrrr�format�_line�description�rrrs   r �test_file_does_not_existz#TestLoader.test_file_does_not_exist%s��������+�+�K�8�8������C���-�-�.�.�.����(�/�/��/�E�E��L��O�!�-�	
�	
�	
�	
�	
r"c��tj��}tj�|d��}tj|��t
tj�|d��d��5}|�d��ddd��n#1swxYwYt
tj�|d��d��5}|�d��ddd��n#1swxYwYt��}|�	|g��}|�
dt|j����dS)N�subz
a_file.tap�wzok A passing testzanother_file.tapznot ok A failing test�)
r�mkdtemp�os�path�join�mkdir�openrr�loadrrr)r�	directory�
sub_directory�frrs      r �test_handles_directoryz!TestLoader.test_handles_directory1s����$�&�&�	�����Y��6�6�
�
������
�"�'�,�,�y�,�7�7��
=�
=�	)��
�G�G�'�(�(�(�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)�
�"�'�,�,�}�.@�A�A�3�
G�
G�	-�1�
�G�G�+�,�,�,�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-��������Y�K�(�(������C���-�-�.�.�.�.�.s$�6B�B�B�C3�3C7�:C7c���tjd��}tjd���}|�|�d����|���t��}|�|j	��}|�
dt|j����|�
d|jdj
j��dS)NzGTAP version 13
            TAP version 13
            1..0
            Fr
rr$z Multiple version lines appeared.r�rrrrrrrrrrrrrr'r(rs     r �'test_errors_with_multiple_version_linesz2TestLoader.test_errors_with_multiple_version_lines?s����!�
�
�
���*�%�8�8�8���
�
�6�=�=��)�)�*�*�*��
�
���������+�+�D�I�6�6������C���-�-�.�.�.����.���Q��0E�0Q�	
�	
�	
�	
�	
r"c���tjd��}tjd���}|�|�d����|���t��}|�|j	��}|�
dt|j����|�
d|jdj
j��dS)NzY# Something that doesn't belong.
            TAP version 13
            1..0
            Fr
rr$z&The version must be on the first line.rr;rs     r �*test_errors_with_version_not_on_first_linez5TestLoader.test_errors_with_version_not_on_first_lineRs����!�
�
�
���*�%�8�8�8���
�
�6�=�=��)�)�*�*�*��
�
���������+�+�D�I�6�6������C���-�-�.�.�.����4��L��O�!�-�	
�	
�	
�	
�	
r"c���tjd��}tjd���}|�|�d����|���t��}|�|j	��}|�
dt|j����|�
d|jdj
j��dS)NzZ1..0 # Skipping this test file.
            ok This should not get processed.
            Fr
rr$zSkipping this test file.rr;rs     r �test_skip_plan_aborts_loadingz(TestLoader.test_skip_plan_aborts_loadingfs����!�
�
�
��
�*�%�8�8�8���
�
�6�=�=��)�)�*�*�*��
�
���������+�+�D�I�6�6������C���-�-�.�.�.����3�U�\�!�_�5J�5V�W�W�W�W�Wr"ztap.parser.sys.stdin�c��t��}|���}|�t|tj����dS)N)r�load_suite_from_stdin�
assertTrue�
isinstance�unittest�	TestSuiter)s   r �test_loads_from_streamz!TestLoader.test_loads_from_streamvsA�������,�,�.�.�����
�5�(�*<�=�=�>�>�>�>�>r"N)�__name__�
__module__�__qualname__�__doc__r!r*r9r<r>r@r�patchrrH�r"r rrs�������%�%�/�/�/�,

�

�

�/�/�/�
�
�
�&
�
�
�(X�X�X� �T�Z�&����
�
�6�6�?�?�7�6�?�?�?r"r)r�iorr0rrFr�
tap.loaderr�	tap.testsrrrNr"r �<module>rRs�������������	�	�	�	���������������������������n?�n?�n?�n?�n?��n?�n?�n?�n?�n?r"

Filemanager

Name Type Size Permission Actions
__init__.cpython-311.pyc File 309 B 0644
factory.cpython-311.pyc File 2.46 KB 0644
run.cpython-311.pyc File 1.14 KB 0644
test_adapter.cpython-311.pyc File 3.76 KB 0644
test_directive.cpython-311.pyc File 2.6 KB 0644
test_formatter.cpython-311.pyc File 1.54 KB 0644
test_line.cpython-311.pyc File 3.46 KB 0644
test_loader.cpython-311.pyc File 7.51 KB 0644
test_main.cpython-311.pyc File 4.37 KB 0644
test_parser.cpython-311.pyc File 29.05 KB 0644
test_result.cpython-311.pyc File 7.55 KB 0644
test_rules.cpython-311.pyc File 6.42 KB 0644
test_runner.cpython-311.pyc File 5.55 KB 0644
test_tracker.cpython-311.pyc File 21.82 KB 0644
testcase.cpython-311.pyc File 965 B 0644