Your IP : 216.73.217.129


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



���]��@s�dZdZddlZddlmZmZed�ZddlZddlZddl	m
Z
ej�ZGdd�dej
�ZGd	d
�d
ej�Zedkr�ej�dS)��2�N)�
start_threads�
import_module�	threading)�	print_excc@s(eZdZdZdZdd�ZdS)�TempFileGreedyrc
Cs�tj�|_tj�xjtt�D]\}ytjd�}|j	�Wn'|j
d7_
td|j�Yq&X|jd7_q&WdS)Nzw+b��file)
�io�StringIO�errors�
startEvent�wait�range�FILES_PER_THREAD�tempfile�
TemporaryFile�close�error_countr�ok_count)�self�i�f�r�:/opt/alt/python35/lib64/python3.5/test_threadedtempfile.py�run!s
zTempFileGreedy.runN)�__name__�
__module__�__qualname__rrrrrrrrsrc@seZdZdd�ZdS)�ThreadedTempFileTestcCs�dd�tt�D�}t|tj��WdQRXtdd�|D��}dd�|D�}dt|�|dj|�f}|j|g|�|j|tt	�dS)NcSsg|]}t��qSr)r)�.0rrrr�
<listcomp>1s	z2ThreadedTempFileTest.test_main.<locals>.<listcomp>css|]}|jVqdS)N)r)r!�trrr�	<genexpr>4sz1ThreadedTempFileTest.test_main.<locals>.<genexpr>cSs;g|]1}|jrt|j�t|jj���qSr)r�str�namer
�getvalue)r!r#rrrr"5s	zErrors: errors %d ok %d
%s�
)
r�NUM_THREADSrr�set�sum�len�joinZassertEqualr)r�threads�okr
�msgrrr�	test_main0s	
zThreadedTempFileTest.test_mainN)rrrr1rrrrr /sr �__main__)r)rrZtest.supportrrrZunittestr�	tracebackr�Eventr�ThreadrZTestCaser r�mainrrrr�<module>s