Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/tap/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/tap/__pycache__/tracker.cpython-311.pyc

�

�܋f���t�ddlZddlmZddlmZ	ddlZddlZdZn
#e$rdZYnwxYwGd�de	��Z
dS)�N)�	Directive)�ResultTFc��eZdZ						dd�Zd�Zd�Zeee��Zd�Zdd	�Z	dd
�Z
d�Zd�Zd
�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)�TrackerNFTc�^�||_||_d|_g|_||_||_||_d|_||_i|_	t�dd��|_|jr=|�
|j��|j�|�|j��dSdSdS)NrFz \/
z----)�outdir�combined�combined_line_number�combined_test_cases_seen�	streaming�stream�plan�
_plan_written�header�_test_cases�str�	maketrans�_sanitized_table�_write_tap_version�_write_plan)�selfrr	rr
rrs       �\/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/tap/tracker.py�__init__zTracker.__init__s������!��
�$%��!�
)+��%�#��������	�"��������� #�
�
�h�� ?� ?����>�	.��#�#�D�K�0�0�0��y�$�� � ���-�-�-�-�-�	.�	.�$�$�c��|jS�N)�_outdir)rs r�_get_outdirzTracker._get_outdir8s
���|�rc��||_|r5tj�|��stj|��dSdSdSr)r�os�path�exists�makedirs)rrs  r�_set_outdirzTracker._set_outdir;sP������	 �"�'�.�.��0�0�	 ��K�������	 �	 �	 �	 rc���|j�|���V|jr"|jr|�||j��g|j|<|jr|j�|��dSdSdS)z-Keep track of which test cases have executed.N)	r�getrr�_write_test_case_headerr
r	r�append�r�
class_names  r�_trackzTracker._trackBs�������
�+�+�3��~�
F�$�+�
F��,�,�Z���E�E�E�+-�D��Z�(��}�
A��-�4�4�Z�@�@�@�@�@�
4�3�

A�
Ar�c��td|�|��|t|�����}|�||��dS)NT��ok�number�description�	directive�r�_get_next_line_numberr�	_add_line)rr*r1r2�results     r�add_okzTracker.add_okLsT�����-�-�j�9�9�#��	�*�*�	
�
�
��	
���z�6�*�*�*�*�*rc	��td|�|��||t|�����}|�||��dS)NF)r/r0r1�diagnosticsr2r3)rr*r1r2r9r6s      r�
add_not_okzTracker.add_not_okUsW�����-�-�j�9�9�#�#��	�*�*�
�
�
��	
���z�6�*�*�*�*�*rc���d�|��}td|�|��|t|�����}|�||��dS)NzSKIP {0}Tr.)�formatrr4rr5)rr*r1�reasonr2r6s      r�add_skipzTracker.add_skip_sg���%�%�f�-�-�	����-�-�j�9�9�#��	�*�*�	
�
�
��	
���z�6�*�*�*�*�*rc��|�|��|jrt||j���|j|�|��dS)N��file)r+r�printr
rr()rr*r6s   rr5zTracker._add_lineisU�����J�����>�	,��&�t�{�+�+�+�+����$�+�+�F�3�3�3�3�3rc��|js|jr|xjdz
c_|jS	t|j|��dzS#t
$rYdSwxYw)N�)r	rr
�lenr�KeyErrorr)s  rr4zTracker._get_next_line_numberosv���=�
	�D�N�
	��%�%��*�%�%��,�,�
��4�+�J�7�8�8�1�<�<���
�
�
��q�q�
���s�A�
A�Ac��||_|jr%|js|�|j��dSdS|jst
d���dS)z6Notify the tracker how many total tests there will be.z;set_plan can only be used with combined or streaming outputN)rrrrr
r	�
ValueError)r�totals  r�set_planzTracker.set_plan|so����	��>�
	�
�0�
.�� � ���-�-�-�-�-�
.�
.���	��M���
�	�	rc��|jr>|js5td�|j��|j���d|_dS|jr�d}|jr%tj	�
|j|��}t|d��5}|�|��|j
�)td�|j
��|���|jD]$}|�||j||���%|j
�)td�|j��|���ddd��dS#1swxYwYdS|j���D]l\}}t|�|��d��5}|�|��|�|||��ddd��n#1swxYwY�mdS)z�Generate TAP reports.

        The results are either combined into a single output file or
        the output file name is generated from the test case.
        �1..{0}r@TNztestresults.tap�w)rrrBr<r
r
r	rr r!�join�openrrr�generate_tap_reportr�items�_get_tap_file_path)r�
combined_file�out_file�	test_case�	tap_liness     r�generate_tap_reportszTracker.generate_tap_reports�s����>�	��%�
*��h�o�o�d�&?�@�@�t�{�S�S�S�S�%)��"��F��=�	M�-�M��{�
I� "����T�[�-� H� H�
��m�S�)�)�	
U�X��'�'��1�1�1��9�(��(�/�/�$�)�4�4�8�D�D�D�D�!%�!>���I��,�,�!�4�#3�I�#>�������9�$��(�/�/�$�*C�D�D�8�T�T�T�T�	
U�	
U�	
U�	
U�	
U�	
U�	
U�	
U�	
U�	
U�	
U�	
U����	
U�	
U�	
U�	
U�	
U�	
U�)-�(8�(>�(>�(@�(@�
M�
M�$�	�9��$�1�1�)�<�<�c�B�B�M�h��+�+�H�5�5�5��,�,�Y�	�8�L�L�L�M�M�M�M�M�M�M�M�M�M�M����M�M�M�M��
M�
Ms%�B"D:�:D>�D>�-G�G	�G	c���|�||��|D]}t||����|js3td�t	|����|���dSdS)Nr@rL)r'rBr	r<rE)rrUrVrT�tap_lines     rrPzTracker.generate_tap_report�s����$�$�Y��9�9�9�!�	+�	+�H��(��*�*�*�*�*��}�	B��(�/�/�#�i�.�.�1�1��A�A�A�A�A�A�	B�	Brc�:�trtd|���dSdS)zYWrite a Version 13 TAP row.

        ``filename`` can be a filename or a stream.
        zTAP version 13r@N)�ENABLE_VERSION_13rB)r�filenames  rrzTracker._write_tap_version�s0��
�	3��"��2�2�2�2�2�2�	3�	3rc��|j�9|js)td�|j��|���d|_dSdS)z�Write the plan line to the stream.

        If we have a plan and have not yet written it out, write it to
        the given stream.
        NrLr@T)rrrBr<)rr
s  rrzTracker._write_plan�sN���9� ��%�
?��h�o�o�d�i�0�0�v�>�>�>�>�!%�D����!� rc�P�td�|���|���dS)Nz# TAP results for {test_case})rUr@)rBr<)rrUr
s   rr'zTracker._write_test_case_header�s.��
�-�4�4�y�4�I�I�PV�W�W�W�W�W�Wrc��|�|j��}|dz}|jr%tj�|j|��S|S)z/Get the TAP output file path for the test case.z.tap)�	translaterrr r!rN)rrU�sanitized_test_case�tap_files    rrRzTracker._get_tap_file_path�sJ��'�1�1�$�2G�H�H��&��/���;�	7��7�<�<���X�6�6�6��r)NFFNTN)r,)r,N)�__name__�
__module__�__qualname__rrr$�propertyrr+r7r:r>r5r4rJrWrPrrr'rR�rrrrsH�����������
�&.�&.�&.�&.�P��� � � �
�X�k�;�
/�
/�F�A�A�A�+�+�+�+�+�+�+�+�+�+�+�4�4�4����
�
�
� M� M� M�D	B�	B�	B�3�3�3�	&�	&�	&�X�X�X�����rr)r �
tap.directiver�tap.liner�more_itertools�yamlr[�ImportError�objectrrgrr�<module>rns���	�	�	�	�#�#�#�#�#�#�������������K�K�K�����������������E�E�E�E�E�f�E�E�E�E�Es�
�'�'

Hacked By AnonymousFox1.0, Coded By AnonymousFox