Your IP : 216.73.216.52


Current Path : /opt/alt/python35/lib64/python3.5/test/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/test/__pycache__/test_contains.cpython-35.opt-1.pyc



��Yf�	�@s�ddlmZddlZGdd�d�ZGdd�de�ZGdd�de�ZGd	d
�d
ej�Zedkr�ej	�dS)�)�dequeNc@seZdZdd�ZdS)�base_setcCs
||_dS)N)�el)�selfr�r�7/opt/alt/python35/lib64/python3.5/test/test_contains.py�__init__szbase_set.__init__N)�__name__�
__module__�__qualname__rrrrrrsrc@seZdZdd�ZdS)�mysetcCs
|j|kS)N)r)rrrrr�__contains__
szmyset.__contains__N)r	r
rr
rrrrr	src@seZdZdd�ZdS)�seqcCs|jg|S)N)r)r�nrrr�__getitem__szseq.__getitem__N)r	r
rrrrrrr
src@s4eZdZdd�Zdd�Zdd�ZdS)�TestContainscs�td��td�}td�}|jd|�|jd|�|jd|�|jd|�|jt�fdd��|jt�fdd��|jdd�|jdd�|jd	d	�|jd	d�|jtd
d��dS)N�rcs
d�kS)Nrrr)�arr�<lambda>sz0TestContains.test_common_tests.<locals>.<lambda>cs
d�kS)Nrrr)rrrrs�c�abc�d�cSs
ddkS)Nrrrrrrr$s)rrr�assertIn�assertNotInZassertRaises�	TypeError)r�brr)rr�test_common_testsszTestContains.test_common_testscCs�td�}x|D]}|j||�qW|jd|�|j||�t|�}x|D]}|j||�q`W|jd|�|j||�Gdd�d�}|j|�|j�dS)N�
�c@s4eZdZdZeed��Zdd�ZdS)z: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.
            �cSs@|dkr<|jjd�|jjd�|jjd�dS)N��
�r)�aList�remove)r�otherrrr�__eq__;s
zATestContains.test_builtin_sequence_types.<locals>.Deviant1.__eq__N)r	r
r�__doc__�list�ranger$r'rrrr�Deviant14sr+)r*rr�tupler$)rr�ir+rrr�test_builtin_sequence_types&s

z(TestContains.test_builtin_sequence_typescCs�Gdd�dt�}td�ddd|�f}tttjtttf}xg|D]_}||�}x|D]}|j	||�qoW|j
|||�k�|j
||k�qVWdS)Nc@s(eZdZdd�Zdd�ZdS)z6TestContains.test_nonreflexive.<locals>.MyNonReflexivecSsdS)NFr)rr&rrrr'Isz=TestContains.test_nonreflexive.<locals>.MyNonReflexive.__eq__cSsdS)N�r)rrrr�__hash__Ksz?TestContains.test_nonreflexive.<locals>.MyNonReflexive.__hash__N)r	r
rr'r0rrrr�MyNonReflexiveHsr1�nanrr)�object�floatr)r,�dict�fromkeys�set�	frozensetrrZ
assertTrue)rr1�valuesZconstructors�constructorZ	container�elemrrr�test_nonreflexiveDs

zTestContains.test_nonreflexiveN)r	r
rrr.r<rrrrrsr�__main__)
�collectionsrZunittestrrrZTestCaserr	�mainrrrr�<module>sG