Your IP : 216.73.216.213


Current Path : /opt/alt/python34/lib64/python3.4/test/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/test/__pycache__/test_contains.cpython-34.pyc

�
g fQ
�@s�ddlmZddlmZddlZGdd�d�ZGdd�de�ZGdd	�d	e�ZGd
d�dej�Z	dd
�Z
edkr�e
�ndS)�)�deque)�run_unittestNc@seZdZdd�ZdS)�base_setcCs
||_dS)N)�el)�selfr�r�7/opt/alt/python34/lib64/python3.4/test/test_contains.py�__init__szbase_set.__init__N)�__name__�
__module__�__qualname__r	rrrrrsrc@seZdZdd�ZdS)�mysetcCs
|j|kS)N)r)rrrrr�__contains__szmyset.__contains__N)r
rrrrrrrr

sr
c@seZdZdd�ZdS)�seqcCs|jg|S)N)r)r�nrrr�__getitem__szseq.__getitem__N)r
rrrrrrrrs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.
            �cSsC|dkr?|jjd�|jjd�|jjd�ndS)N��
�r)�aList�remove)r�otherrrr�__eq__<s
zATestContains.test_builtin_sequence_types.<locals>.Deviant1.__eq__N)r
rr�__doc__�list�ranger%r(rrrr�Deviant15s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(Jsz=TestContains.test_nonreflexive.<locals>.MyNonReflexive.__eq__cSsdS)N�r)rrrr�__hash__Lsz?TestContains.test_nonreflexive.<locals>.MyNonReflexive.__hash__N)r
rrr(r1rrrr�MyNonReflexiveIsr2�nanrr)�object�floatr*r-�dict�fromkeys�set�	frozensetrrZ
assertTrue)rr2�valuesZconstructors�constructorZ	container�elemrrr�test_nonreflexiveEs

zTestContains.test_nonreflexiveN)r
rrrr/r=rrrrrsrcCstt�dS)N)rrrrrr�	test_mainYsr>�__main__)�collectionsrZtest.supportrZunittestrr
rZTestCaserr>r
rrrr�<module>sG