Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_contains.cpython-311.opt-1.pyc
�

�Keh
����ddlmZddlZddlmZGd�d��ZGd�de��ZGd�d	e��ZGd
�dej��Z	e
dkrej��dSdS)
�)�dequeN)�NEVER_EQc��eZdZd�ZdS)�base_setc��||_dS�N��el��selfr
s  �</usr/local/apps/python3/lib/python3.11/test/test_contains.py�__init__zbase_set.__init__s
�������N)�__name__�
__module__�__qualname__r�rr
rrs#����������rrc��eZdZd�ZdS)�mysetc��|j|kSrr	rs  r
�__contains__zmyset.__contains__s���w�"�}�rN�rrrrrrr
rr
s#����������rrc��eZdZd�ZdS)�seqc��|jg|Srr	)r�ns  r
�__getitem__zseq.__getitem__s����y��|�rN)rrrrrrr
rrs#����������rrc�&�eZdZd�Zd�Zd�Zd�ZdS)�TestContainsc�r��td���td��}td��}|�d|��|�d|��|�d|��|�d|��|�t�fd���|�t�fd���|�dd��|�dd��|�dd��|�dd��|�td	���dS)
N�rc���d�vS�Nr!r��as�r
�<lambda>z0TestContains.test_common_tests.<locals>.<lambda>s���Q�!�V�rc���d�vSr#rr$s�r
r&z0TestContains.test_common_tests.<locals>.<lambda>s���Q�a�Z�r�c�abc�d�c�
�ddvS)Nr)rrrr
r&z0TestContains.test_common_tests.<locals>.<lambda>%s
��T�U�]�r)rrr�assertIn�assertNotIn�assertRaises�	TypeError)r�br(r%s   @r
�test_common_testszTestContains.test_common_testss(����Q�K�K���!�H�H����F�F���
�
�a���������A�����
�
�a���������A�������)�^�^�^�^�4�4�4����)�%7�%7�%7�%7�8�8�8�	
�
�
�c�5�!�!�!�����e�$�$�$��
�
�b�"�����
�
�b�%� � � ����)�%:�%:�;�;�;�;�;rc��td��}|D]}|�||���|�d|��|�||��t|��}|D]}|�||���|�d|��|�||��Gd�d��}|�|��|j��dS)N�
�c�@�eZdZdZeed����Zd�ZdS)�:TestContains.test_builtin_sequence_types.<locals>.Deviant1z�Behaves strangely when compared

            This class is designed to make sure that the contains code
            works when the list is modified during the check.
            �c��|dkrN|j�d��|j�d��|j�d��dS)N��
�r)�aList�remove�r�others  r
�__eq__zATestContains.test_builtin_sequence_types.<locals>.Deviant1.__eq__<sR���B�;�;��J�%�%�b�)�)�)��J�%�%�b�)�)�)��J�%�%�b�)�)�)��qrN)rrr�__doc__�list�ranger=rArrr
�Deviant1r75sD������
�
�
�D���r���O�O�E�
�
�
�
�
rrE)rDr-r.�tupler=)rr%�irEs    r
�test_builtin_sequence_typesz(TestContains.test_builtin_sequence_types's
���"�I�I���	 �	 �A��M�M�!�Q���������Q��������A�����!�H�H���	 �	 �A��M�M�!�Q���������Q��������A����	�	�	�	�	�	�	�	�	
�������X�^�4�4�4�4�4rc�Z�td��dddtf}tttjtttf}|D]c}||��}|D]}|�	||���|�
|||��k��|�
||k���ddS)N�nanr!r))�floatrrCrF�dict�fromkeys�set�	frozensetrr-�
assertTrue)r�values�constructors�constructor�	container�elems      r
�test_nonreflexivezTestContains.test_nonreflexiveEs����u���q�$��x�7���U�D�M�3�	�5�H��'�	4�	4�K�#��F�+�+�I�!�
/�
/���
�
�d�I�.�.�.�.��O�O�I���V�)<�)<�<�=�=�=��O�O�I��2�3�3�3�3�	4�	4rc�$��Gd�dt��}|��}Gd�d|��}|���|�d|v��|�dt���v��|�t�fd���dS)Nc��eZdZd�ZdS)�4TestContains.test_block_fallback.<locals>.ByContainsc��dS)NFrr?s  r
rzATestContains.test_block_fallback.<locals>.ByContains.__contains__Us���urNrrrr
�
ByContainsrYTs#������
�
�
�
�
rr[c��eZdZdZd�ZdZdS)�7TestContains.test_block_fallback.<locals>.BlockContainsa�Is not a container

            This class is a perfectly good iterable (as tested by
            list(bc)), as well as inheriting from a perfectly good
            container, but __contains__ = None prevents the usual
            fallback to iteration in the container protocol. That
            is, normally, 0 in bc would fall back to the equivalent
            of any(x==0 for x in bc), but here it's blocked from
            doing so.
            c3�
K�dSrr)rs r
�__iter__z@TestContains.test_block_fallback.<locals>.BlockContains.__iter__cs�����rN)rrrrBr_rrrr
�
BlockContainsr]Xs.������	
�	
�
�
�
� �L�L�Lrr`rc���d�vS)Nrr)�bcs�r
r&z2TestContains.test_block_fallback.<locals>.<lambda>js���Q�"�W�r)�object�assertFalserCr/r0)rr[r(r`rbs    @r
�test_block_fallbackz TestContains.test_block_fallbackRs����	�	�	�	�	��	�	�	�
�J�L�L��	 �	 �	 �	 �	 �J�	 �	 �	 ��]�_�_������a�� � � �����d�2�h�h��'�'�'����)�_�_�_�_�5�5�5�5�5rN)rrrr2rHrVrerrr
rrsP������<�<�<�(5�5�5�<4�4�4�6�6�6�6�6rr�__main__)�collectionsr�unittest�test.supportrrrr�TestCaserr�mainrrr
�<module>rls
������������!�!�!�!�!�!��������������H���������(����X6�X6�X6�X6�X6�8�$�X6�X6�X6�t�z����H�M�O�O�O�O�O��r