File: //usr/local/lib/python3.10/test/test_asyncio/__pycache__/test_protocols.cpython-310.opt-2.pyc
o
�i� � @ sN d dl Z d dl mZ d dlZdd� ZG dd� de j�Zedkr%e �� dS dS )� N)�mockc C s t �d � d S )N)�asyncioZset_event_loop_policy� r r �=/usr/local/lib/python3.10/test/test_asyncio/test_protocols.py�tearDownModule s r c @ s4 e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� ZdS )�ProtocolsAbsTestsc C s` t �� }t�� }| �|�|�� | �|�|�� | �|�� � | �|�� � | � t
|d�� d S �N�__dict__)r �Mockr ZBaseProtocol�assertIsNone�connection_made�connection_lost�
pause_writing�resume_writing�assertFalse�hasattr��self�f�pr r r �test_base_protocol s z$ProtocolsAbsTests.test_base_protocolc C s~ t �� }t�� }| �|�|�� | �|�|�� | �|�|�� | �|�� � | �|� � � | �|�
� � | �t|d�� d S r )
r r
r ZProtocolr r r
Z
data_receivedZeof_receivedr r r r r r r r �
test_protocol s zProtocolsAbsTests.test_protocolc C s� t �� }t�� }| �|�|�� | �|�|�� | �|�d�� | �|�d�� | �|� � � | �|�
� � | �t|d�� d S )N�d � r )
r r
r ZBufferedProtocolr r r
Z
get_bufferZbuffer_updatedr r r r r r r r �test_buffered_protocol# s z(ProtocolsAbsTests.test_buffered_protocolc C sf t �� }t�� }| �|�|�� | �|�|�� | �|�|�� | �|�||�� | � t
|d�� d S r )r r
r ZDatagramProtocolr r r
Zerror_receivedZdatagram_receivedr r )r r Zdpr r r �test_datagram_protocol. s z(ProtocolsAbsTests.test_datagram_protocolc C sv t �� }t�� }| �|�|�� | �|�|�� | �|�d|�� | �|�d|�� | �|� � � | �
t|d�� d S )N� r )r r
r ZSubprocessProtocolr r r
Zpipe_data_receivedZpipe_connection_lostZprocess_exitedr r )r r �spr r r �test_subprocess_protocol7 s z*ProtocolsAbsTests.test_subprocess_protocolN)�__name__�
__module__�__qualname__r r r r r r r r r r
s r �__main__)Zunittestr r r ZTestCaser r �mainr r r r �<module> s 5�