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_dictcomps.cpython-34.pyo

�
g f��@sXddlZddlmZdZGdd�dej�ZedkrTej�ndS)�N)�supportzGlobal variablec@sXeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�DictComprehensionTestcCs�i
dd6dd6dd6dd6d	d
6dd6d
d6dd6dd6dd6}dd�td�D�}|j||�i
dd6dd6dd6dd6d
d
6dd6dd6dd6dd6dd6}dd�td�D�}|j||�dS)N�
r�����
�������������	cSsi|]}|d|�qS)r�)�.0�krr�8/opt/alt/python34/lib64/python3.4/test/test_dictcomps.py�
<dictcomp>s	z5DictComprehensionTest.test_basics.<locals>.<dictcomp>cSs8i|].}td�D]}||kr||�qqS)r)�range)rr�vrrrrs	)r�assertEqual)�self�expected�actualrrr�test_basicss;Lz!DictComprehensionTest.test_basicscCs	d}i
dd6dd6dd6dd6dd6dd6dd6dd	6dd
6dd6}dd
�td�D�}|j||�|j|d�i-dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd 6dd!6dd"6d	d#6d	d$6d	d%6d	d&6d	d'6d	d(6d	d)6d
d*6d
d+6d
d,6d
d-6d
d.6d
d/6d
d06d
d16dd26dd36dd46dd56dd66dd76dd86dd96dd:6}d;d
�td�D�}|j|d�|j||�dS)<NzLocal Variablerrrr
rrrrrrcSsi|]}d|�qS)Nr)rrrrrrs	z>DictComprehensionTest.test_scope_isolation.<locals>.<dictcomp>rrr����$�%�&�'�-�.�/�0�1�6�7�8�9�:�;�?�@�A�B�C�D�E�H�I�J�K�L�M�N�O�Q�R�S�T�U�V�W�X�YcSs7i|]-}t|d|d�D]}||�q!qS)rr)r)rrrrrrr$s	)rr)rrr r!rrr�test_scope_isolations-;8888&z*DictComprehensionTest.test_scope_isolationcCsi
dd6dd6dd6dd6dd6dd6dd6dd6dd	6dd
6}dd�td
�D�}|j||�|jtd�i-dd
6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd 6dd!6dd"6dd#6dd$6dd%6dd&6dd'6dd(6dd)6d	d*6d	d+6d	d,6d	d-6d	d.6d	d/6d	d06d	d16d
d26d
d36d
d46d
d56d
d66d
d76d
d86d
d96d
d:6}d;d�td
�D�}|jtd�|j||�dS)<Nrrrr
rrrrrrcSsi|]}d|�qS)Nr)r�grrrr+s	zJDictComprehensionTest.test_scope_isolation_from_global.<locals>.<dictcomp>rzGlobal variablerrr#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLcSs7i|]-}t|d|d�D]}||�q!qS)rr)r)rrrNrrrr5s	)rrrN)rr r!rrr� test_scope_isolation_from_global(s-;8888&z6DictComprehensionTest.test_scope_isolation_from_globalcCsyi
dd6dd6dd6dd6dd6dd6dd6dd	6dd
6dd6}dd
�td�D�}|j||�dS)NzGlobal variablerrrr
rrrrrrcSsi|]}t|�qSr)rN)rrrrrr?s	z@DictComprehensionTest.test_global_visibility.<locals>.<dictcomp>r)rr)rr r!rrr�test_global_visibility9sz,DictComprehensionTest.test_global_visibilitycs�d�i
dd6dd6dd6dd6dd6dd6dd6dd	6dd
6dd6}�fdd
�td�D�}|j||�|j�d�dS)NzLocal variablerrrr
rrrrrrcsi|]}�|�qSrr)rr)rrrrIs	z?DictComprehensionTest.test_local_visibility.<locals>.<dictcomp>r)rr)rr r!r)rr�test_local_visibilityBsz+DictComprehensionTest.test_local_visibilitycCsV|jtd��tddd�WdQX|jtd��tddd�WdQXdS)Nzcan't assignz'{x: y for y, x in ((1, 2), (3, 4))} = 5z<test>�execz({x: y for y, x in ((1, 2), (3, 4))} += 5)ZassertRaisesRegex�SyntaxError�compile)rrrr�test_illegal_assignmentMs	
	z-DictComprehensionTest.test_illegal_assignmentN)	�__name__�
__module__�__qualname__r"rMrOrPrQrUrrrrr	s
	r�__main__)ZunittestZtestrrNZTestCaserrV�mainrrrr�<module>s
N