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__/rules.cpython-311.pyc

�

�܋f�
��F�ddlmZddlmZddlmZGd�de��ZdS)�)�Adapter)�	Directive)�Resultc�V�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
S)�Rulesc�8�||_||_gdgd�|_dS)Nr)�plan�test�version)�	_filename�_suite�_lines_seen)�self�filename�suites   �Z/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/tap/rules.py�__init__zRules.__init__s(��!������$&��b�A�A�����c�r�|jdr|���|�|��dS)z;Check the status of all provided data and update the suite.rN)r�_process_version_lines�_process_plan_lines)r�final_line_counts  r�checkzRules.checks?����I�&�	*��'�'�)�)�)�� � �!1�2�2�2�2�2rc���t|jd��dkr|�d��dS|jdddkr|�d��dSdS)zProcess version line rules.r�z Multiple version lines appeared.rz&The version must be on the first line.N)�lenr�
_add_error�rs rrzRules._process_version_linesso���t��	�*�+�+�a�/�/��O�O�>�?�?�?�?�?�
�
�i�
(��
+�q�
0�
0��O�O�D�E�E�E�E�E�1�
0rc���|jds|�d��dSt|jd��dkr|�d��dS|jdd\}}|�||��s|�d��dS|j|jdkr<|�d	�|j|jd�
����dSdS)zProcess plan line rules.r	zMissing a plan.Nrz)Only one plan line is permitted per file.rz7A plan must appear at the beginning or end of the file.r
z:Expected {expected_count} tests but only {seen_count} ran.)�expected_count�
seen_count)rrr�_plan_on_valid_line�expected_tests�format)rrr	�at_lines    rrzRules._process_plan_liness�����'�	��O�O�-�.�.�.��F��t���'�(�(�1�,�,��O�O�G�H�H�H��F��(��0��3�
��g��'�'��1A�B�B�	��O�O�U�V�V�V��F���$�"2�6�":�:�:��O�O�L�S�S�#'�#6�#�/��7�T���
�
�
�
�
�;�:rc�~�|dks||krdS|jdo|jdddko|dk}|rdSdS)z#Check if a plan is on a valid line.rTrr�F�r)rr%r�
after_versions    rr"zRules._plan_on_valid_line0si���a�<�<�7�&6�6�6��4�
��Y�'�
�� ��+�A�.�!�3�
��1��	�
�	��4��urc�b�|�d�|j�����dS)zHandle a bail line.zBailed: {reason})�reasonN)rr$r+)r�bails  r�handle_bailzRules.handle_bailAs.�����*�1�1���1�E�E�F�F�F�F�Frc�b�|�d�|j�����dS)z'Handle a test file that does not exist.z{filename} does not exist.)rN)rr$rrs r�handle_file_does_not_existz Rules.handle_file_does_not_existEs.�����4�;�;�T�^�;�T�T�U�U�U�U�Urc��tdd|jjtd����}|j�t
|j|����dS)z-Handle a plan that contains a SKIP directive.TN�SKIP)r�	directive�textrr
�addTestrr)r�	skip_plan�	skip_lines   r�handle_skipping_planzRules.handle_skipping_planIsK���4��y�':�'?��6�AR�AR�S�S�	�����G�D�N�I�>�>�?�?�?�?�?rc�J�|jd�||f��dS)z!Record when a plan line was seen.r	N�r�append)rr	r%s   r�saw_planzRules.saw_planNs(����� �'�'��w��8�8�8�8�8rc�0�|jdxxdz
cc<dS)z!Record when a test line was seen.r
rNr(rs r�saw_testzRules.saw_testRs'����� � � �A�%� � � � � rc�F�|jd�|��dS)z$Record when a version line was seen.rNr9)r�line_counters  r�saw_version_atzRules.saw_version_atVs$�����#�*�*�<�8�8�8�8�8rc��tdd|td����}|j�t	|j|����dS)zAdd an error test to the suite.FN�)rrr
r4rr)r�message�
error_lines   rrzRules._add_errorZsC���E�4��)�B�-�-�@�@�
�����G�D�N�J�?�?�@�@�@�@�@rN)�__name__�
__module__�__qualname__rrrrr"r-r/r7r;r=r@r�rrrrs�������B�B�B�
3�3�3�F�F�F����.���"G�G�G�V�V�V�@�@�@�
9�9�9�&�&�&�9�9�9�A�A�A�A�ArrN)�tap.adapterr�
tap.directiver�tap.liner�objectrrHrr�<module>rMs���������#�#�#�#�#�#�������WA�WA�WA�WA�WA�F�WA�WA�WA�WA�WAr

Hacked By AnonymousFox1.0, Coded By AnonymousFox