File: //usr/local/lib/python3.10/test/test_asyncio/__pycache__/test_windows_utils.cpython-310.pyc
o
�i� � @ s� d Z ddlZddlZddlZejdkre�d��ddlZddlZddlZddlm Z ddl
mZ dd� ZG d d
� d
ej
�ZG dd� dej
�Zed
krPe�� dS dS )zTests for window_utils� N�win32zWindows only)�
windows_utils)�supportc C s t �d � d S )N)�asyncioZset_event_loop_policy� r r �A/usr/local/lib/python3.10/test/test_asyncio/test_windows_utils.py�tearDownModule s r c @ s e Zd Zdd� Zdd� ZdS )� PipeTestsc
C s� t jdd�\}}z�t�� }| �|j� | �|jd� |�|d� | � |j� | �|jt
j� d}z |�� W td�� t
yR } z
| �|j|� W Y d }~nd }~ww t�� }| �|j� | �|jd� |�|d� | �|jdt
jh� t
�|jgdd�}| �|t
j� | �|j� | �|j|� | �|j� | �|jdt
jh� | �|�� d� W t
�|� t
�|� d S t
�|� t
�|� w ) N�TT�Z
overlappedr �d i� zexpected ERROR_IO_INCOMPLETEs helloF)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�resr r r �test_pipe_overlapped s@
���
�zPipeTests.test_pipe_overlappedc
C s� t jdd�\}}t�|� t �|�}| �|�� |� | �|j|� t� � � t�
ddt� ~t�
� W d � n1 s<w Y z
t�|� W td�� tye } z| �|jd� W Y d }~d S d }~ww )Nr
r �ignore� � zexpected ERROR_INVALID_HANDLE)r r
r r �
PipeHandler �fileno�handle�warnings�catch_warnings�filterwarnings�ResourceWarningr �
gc_collectr r r )r �h�_�pr! r r r �test_pipe_handle= s"