Your IP : 216.73.216.60


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



���]{�@s@ddlZddlmZddlmZddlmZddlmZdZ	Gdd�d�Z
Gd	d
�d
e
�ZGdd�de
ej�Z
Gd
d�de
ej�ZGdd�de
ej�ZGdd�de
ej�ZGdd�deej�ZGdd�deej�ZGdd�deej�ZGdd�deej�ZGdd�deej�ZGdd�deej�ZGdd �d e
ej�ZGd!d"�d"e
ej�ZGd#d$�d$e�ZGd%d&�d&e�ZGd'd(�d(e�ZGd)d*�d*ej�Zed+kr<ej�dS),�N)�support)�repeat)�deque)�length_hint�
c@seZdZdd�ZdS)�TestInvariantWithoutMutationscCs�|j}xAttdtd��D]&}|jt|�|�t|�q#W|jt|�d�|jtt|�|jt|�d�dS)N�r)	�it�reversed�range�n�assertEqualr�next�assertRaises�
StopIteration)�selfr	�i�r�1/opt/alt/python35/lib64/python3.5/test_iterlen.py�test_invariant7s	 z,TestInvariantWithoutMutations.test_invariantN)�__name__�
__module__�__qualname__rrrrrr5src@seZdZdd�ZdS)�TestTemporarilyImmutablecCsz|j}|jt|�t�t|�|jt|�td�|j�|jtt|�|jt|�d�dS)Nrr)r	r
rrr�mutater�RuntimeError)rr	rrr�test_immutable_during_iterationBs	

z8TestTemporarilyImmutable.test_immutable_during_iterationN)rrrrrrrrr@src@seZdZdd�ZdS)�
TestRepeatcCstdt�|_dS)N)rrr	)rrrr�setUpRszTestRepeat.setUpN)rrrrrrrrrPsrc@seZdZdd�ZdS)�
TestXrangecCsttt��|_dS)N)�iterrrr	)rrrrrWszTestXrange.setUpN)rrrrrrrrrUsrc@seZdZdd�ZdS)�TestXrangeCustomReversedcCsttt��|_dS)N)r
rrr	)rrrrr\szTestXrangeCustomReversed.setUpN)rrrrrrrrr!Zsr!c@seZdZdd�ZdS)�	TestTuplecCstttt���|_dS)N)r �tuplerrr	)rrrrraszTestTuple.setUpN)rrrrrrrrr"_sr"c@seZdZdd�ZdS)�	TestDequecCs1ttt��}t|�|_|j|_dS)N)rrrr r	�popr)r�drrrrhszTestDeque.setUpN)rrrrrrrrr$fsr$c@seZdZdd�ZdS)�TestDequeReversedcCs1ttt��}t|�|_|j|_dS)N)rrrr
r	r%r)rr&rrrroszTestDequeReversed.setUpN)rrrrrrrrr'msr'c@seZdZdd�ZdS)�TestDictKeyscCs4tjtt��}t|�|_|j|_dS)N)�dict�fromkeysrrr r	�popitemr)rr&rrrrvszTestDictKeys.setUpN)rrrrrrrrr(tsr(c@seZdZdd�ZdS)�
TestDictItemscCs:tjtt��}t|j��|_|j|_dS)N)	r)r*rrr �itemsr	r+r)rr&rrrr}szTestDictItems.setUpN)rrrrrrrrr,{sr,c@seZdZdd�ZdS)�TestDictValuescCs:tjtt��}t|j��|_|j|_dS)N)	r)r*rrr �valuesr	r+r)rr&rrrr�szTestDictValues.setUpN)rrrrrrrrr.�sr.c@seZdZdd�ZdS)�TestSetcCs1ttt��}t|�|_|j|_dS)N)�setrrr r	r%r)rr&rrrr�sz
TestSet.setUpN)rrrrrrrrr0�sr0c@s(eZdZdd�Zdd�ZdS)�TestListcCsttt��|_dS)N)r rrr	)rrrrr�szTestList.setUpcCs�ttt��}t|�}t|�t|�|jt|�td�|jt�|jt|�td�g|dd�<|jt|�d�|jt|�g�|jtd��|jt|�d�dS)N�rr�)	�listrrr rr
r�append�extend)rr&r	rrr�
test_mutation�s


zTestList.test_mutationN)rrrrr8rrrrr2�sr2c@s(eZdZdd�Zdd�ZdS)�TestListReversedcCsttt��|_dS)N)r
rrr	)rrrrr�szTestListReversed.setUpcCs�ttt��}t|�}t|�t|�|jt|�td�|jt�|jt|�td�g|dd�<|jt|�d�|jt|�g�|jtd��|jt|�d�dS)Nr3rrr4)	r5rrr
rr
rr6r7)rr&r	rrrr8�s


zTestListReversed.test_mutationN)rrrrr8rrrrr9�sr9c@s(eZdZdd�Zdd�ZdS)�BadLencCsttd��S)Nr)r r)rrrr�__iter__�szBadLen.__iter__cCstd��dS)N�hello)r)rrrr�__len__�szBadLen.__len__N)rrrr;r=rrrrr:�sr:c@s(eZdZdd�Zdd�ZdS)�
BadLengthHintcCsttd��S)Nr)r r)rrrrr;�szBadLengthHint.__iter__cCstd��dS)Nr<)r)rrrr�__length_hint__�szBadLengthHint.__length_hint__N)rrrr;r?rrrrr>�sr>c@s(eZdZdd�Zdd�ZdS)�NoneLengthHintcCsttd��S)Nr)r r)rrrrr;�szNoneLengthHint.__iter__cCstS)N)�NotImplemented)rrrrr?�szNoneLengthHint.__length_hint__N)rrrr;r?rrrrr@�sr@c@s(eZdZdd�Zdd�ZdS)�TestLengthHintExceptionscCs�|jttt��|jttt��|jtgjt��|jtgjt��ttd��}|jt|jt��|jt|jt��dS)Nr)rrr5r:r>r7�	bytearrayr)r�brrr�test_issue1242657�sz*TestLengthHintExceptions.test_issue1242657cCs)|jtt��ttd���dS)Nr)r
r5r@r)rrrr�test_invalid_hint�sz*TestLengthHintExceptions.test_invalid_hintN)rrrrErFrrrrrB�s	rB�__main__) ZunittestZtestr�	itertoolsr�collectionsr�operatorrrrrZTestCaserrr!r"r$r'r(r,r.r0r2r9�objectr:r>r@rBr�mainrrrr�<module>,s2