Your IP : 216.73.216.196


Current Path : /opt/alt/python310/lib64/python3.10/test/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/test/__pycache__/test_select.cpython-310.opt-2.pyc

o

0�iF
�@s�ddlZddlZddlZddlZddlZddlZddlZddlmZe�	ej
dd�dkd�Gdd�dej��Zdd	�Z
ed
krFe��dSdS)�N)�support��winz can't easily test on this systemc@s~eZdZGdd�d�ZGdd�d�Zdd�Ze�ej	�
d�d�d	d
��Zdd�Ze�
eed
�d�dd��Zdd�Zdd�ZdS)�SelectTestCasec@seZdZdS)zSelectTestCase.NopeN)�__name__�
__module__�__qualname__�r	r	�7/opt/alt/python310/lib64/python3.10/test/test_select.py�Nopesrc@seZdZdd�ZdS)zSelectTestCase.AlmostcCsdS)N�filenor	��selfr	r	r
rszSelectTestCase.Almost.filenoN�rrrrr	r	r	r
�AlmostsrcCsx|�ttjddd�|�ttj|��ggg�|�ttj|��ggg�|�ttjgggd�|�ttjgggd�dS)N��rznot a number���)ZassertRaises�	TypeError�selectrr�
ValueErrorr
r	r	r
�test_error_conditionss
z$SelectTestCase.test_error_conditionsZfreebsdz*skip because of a FreeBSD bug: kern/155606cCs�ttd��D}|��}|��zt�|gggd�Wnty3}z|�|jtj�WYd}~nd}~ww|�	d�Wd�dSWd�dS1sLwYdS)N�rbrzexception not raised)
�open�__file__r�closer�OSError�assertEqual�errnoZEBADF�fail)r�fp�fd�errr	r	r
�
test_errnos���"�zSelectTestCase.test_errnocCs>t�gggd�\}}}|�||�|�||�|�||�dS)Nr)rZassertIsNot)r�r�w�xr	r	r
�test_returned_list_identity*sz*SelectTestCase.test_returned_list_identity�popenzneed os.popen()c
Cst�d�}tjdd|g}tj|tjd��d}|j}dD]M}tj	r&t
d|���t�|ggg|�\}}}|�|g�|�|g�|sAq||gkr_|�
�}	tj	rSt
t|	��|	s^tj	r\t
d�nq|�d|||�qWd�dSWd�dS1s{wYdS)	Nz�
            import time
            for i in range(10):
                print("testing...", flush=True)
                time.sleep(0.050)
        z-Iz-c)�stdout)rrr���NNNNNNNNNNz
timeout = ZEOFz'Unexpected return values from select():)�textwrap�dedent�sys�
executable�
subprocess�Popen�PIPEr)r�verbose�printrr�readline�reprr)
r�code�cmd�proc�pipeZtimeoutZrfdZwfdZxfd�liner	r	r
�test_select1s8

���"�zSelectTestCase.test_selectcsRg�G�fdd�d�}|�gd�dd�<|�t�g�g�g�dd�gf�dS)NcseZdZ�fdd�ZdS)z-SelectTestCase.test_select_mutated.<locals>.Fcs�d=tj��S)Nr)r/�
__stdout__rr
��ar	r
rTs
z4SelectTestCase.test_select_mutated.<locals>.F.filenoNrr	r?r	r
�FSsrA�
�)rr)rrAr	r?r
�test_select_mutatedQs(z"SelectTestCase.test_select_mutatedcCs:t�|tt����ttd�rt�|tt����dSdS)N�devpoll)rZcheck_disallow_instantiation�typerZpoll�hasattrrEr
r	r	r
�test_disallow_instantiationZs
�z*SelectTestCase.test_disallow_instantiationN)rrrrrr�unittest�skipIfr/�platform�
startswithr#r'Z
skipUnlessrG�osr=rDrHr	r	r	r
r
s�

	rcCst��dS)N)rZ
reap_childrenr	r	r	r
�tearDownModule`srN�__main__)rrMrr1r/r-rI�testrrJrKZTestCaserrNr�mainr	r	r	r
�<module>s �T�