Your IP : 216.73.216.213


Current Path : /opt/alt/python39/lib64/python3.9/test/test_asyncio/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/test/test_asyncio/__pycache__/test_windows_utils.cpython-39.pyc

a

XC?h��@s�dZddlZddlZddlZejdkr0e�d��ddlZddlZddlZddlm	Z	ddl
mZdd�ZGd	d
�d
ej
�ZGdd�dej
�Zed
kr�e��dS)zTests for window_utils�NZwin32zWindows only)�
windows_utils)�supportcCst�d�dS)N)�asyncioZset_event_loop_policy�rr�I/opt/alt/python39/lib64/python3.9/test/test_asyncio/test_windows_utils.py�tearDownModulesrc@seZdZdd�Zdd�ZdS)�	PipeTestsc
Cs�tjdd�\}}�zZt��}|�|j�|�|jd�|�|d�|�	|j�|�|jt
j�d}z|��Wn2t
y�}z|�|j|�WYd}~nd}~00td��t��}|�|j�|�|jd�|�|d�|�|jdt
jh�t
�|jgdd�}|�|t
j�|�|j�|�|j|�|�|j�|�|jdt
jh�|�|��d�Wt
�|�t
�|�nt
�|�t
�|�0dS)	N�TT�Z
overlappedr�di�zexpected ERROR_IO_INCOMPLETEshelloF)r�pipe�_overlapped�
Overlapped�assertFalse�pending�assertEqual�error�ReadFile�
assertTrue�_winapiZERROR_IO_PENDING�	getresult�OSError�winerror�RuntimeError�	WriteFileZassertIn�WaitForMultipleObjects�event�
WAIT_OBJECT_0�CloseHandle)�selfZh1Zh2Zov1ZERROR_IO_INCOMPLETE�eZov2�resrrr�test_pipe_overlappeds<$
�
zPipeTests.test_pipe_overlappedc
Cs�tjdd�\}}t�|�t�|�}|�|��|�|�|j|�t�	��(t�
ddt�~t�
�Wd�n1sx0Yzt�|�Wn2ty�}z|�|jd�WYd}~nd}~00td��dS)Nr	r
�ignore��zexpected ERROR_INVALID_HANDLE)rrrr�
PipeHandler�fileno�handle�warnings�catch_warnings�filterwarnings�ResourceWarningrZ
gc_collectrrr)r�h�_�pr rrr�test_pipe_handle=s


&$zPipeTests.test_pipe_handleN)�__name__�
__module__�__qualname__r"r0rrrrrs%rc@seZdZdd�ZdS)�
PopenTestscCs�d}d}tjtjd|gtjtjtjd�}|j|j|jfD]}|�|tj	�q8t
��}t
��}t
��}|�|jj
|�|�|jj
d�|�|jj
d�|j|j|jg}t�|dttjd��}	|�|	tj�|�|j�|�|j�|�|j�|�|��t|��|����}
|����}|�t|
�d�|�t|�d�|�|�����|
��|�d	�|��|�Wd�n1�s~0YdS)
Nz�if 1:
            import sys
            s = sys.stdin.readline()
            sys.stdout.write(s.upper())
            sys.stderr.write('stderr')
            sblah
z-c)�stdin�stdout�stderrrTi�rsstderr) r�Popen�sys�
executable�PIPEr5r6r7ZassertIsInstancer&r
rrr(rrrr�intrZ
SHORT_TIMEOUTrrrrr�len�rstripZ
assertGreaterr�upper�
startswith)rZcommand�msgr/�fZovinZovoutZoverrZeventsr!�out�errrrr�
test_popenSs@��zPopenTests.test_popenN)r1r2r3rErrrrr4Qsr4�__main__)�__doc__r9Zunittestr)�platformZSkipTestr
rrr�testrrZTestCaserr4r1�mainrrrr�<module>s

;3