Your IP : 216.73.216.213
U
i�fC � @ s� d Z ddlZddlZddlZejdkr0e�d��ddlZddlZddlZddlm Z ddl
mZ dd� ZG d d
� d
ej
�ZG dd� dej
�Zed
kr�e�� dS )zTests for window_utils� NZwin32zWindows only)�
windows_utils)�supportc C s t �d � d S )N)�asyncioZset_event_loop_policy� r r �I/opt/alt/python38/lib64/python3.8/test/test_asyncio/test_windows_utils.py�tearDownModule s r c @ s e Zd Zdd� Zdd� ZdS )� PipeTestsc
C sr t jdd�\}}�zDt�� }| �|j� | �|j d� |�
|d� | �|j� | �|j tj� d}z|�
� W n0 tk
r� } z| �|j|� W 5 d }~X Y n
X td��t�� }| �|j� | �|j d� |�|d� | �|j dtjh� t�|jgdd�}| �|tj� | �|j� | �|j |� | �|j� | �|j dtjh� | �|�
� d� W 5 t�|� t�|� X d S ) N�TT�Z
overlappedr �d i� zexpected ERROR_IO_INCOMPLETEs helloF)r �pipe�_winapi�CloseHandle�_overlapped�
Overlapped�assertFalse�pending�assertEqual�error�ReadFile�
assertTrueZERROR_IO_PENDING� getresult�OSError�winerror�RuntimeError� WriteFileZassertIn�WaitForMultipleObjects�event�
WAIT_OBJECT_0)�selfZh1Zh2Zov1ZERROR_IO_INCOMPLETE�eZov2�resr r r �test_pipe_overlapped s8
zPipeTests.test_pipe_overlappedc
C s� t jdd�\}}t�|� t �|�}| �|�� |� | �|j|� t� � � t�
ddt� ~t�
� W 5 Q R X zt�|� W n0 tk
r� } z| �|jd� W 5 d }~X Y n
X td��d S )Nr r
�ignore� � zexpected ERROR_INVALID_HANDLE)r r r
r �
PipeHandler �fileno�handle�warnings�catch_warnings�filterwarnings�ResourceWarningr Z
gc_collectr r r )r �h�_�pr r r r �test_pipe_handle= s
zPipeTests.test_pipe_handleN)�__name__�
__module__�__qualname__r"