File: //usr/lib/python3/dist-packages/twisted/conch/test/__pycache__/test_channel.cpython-310.pyc
o
�b�/ � @ s� d Z ddlmZ ddlmZ z.ddlmZ ddlmZ ddl m
Z
ddlmZ ddl
mZ dd lmZ dd
lmZ dZW n
eyI dZeZ
Y nw dd
lmZ G dd� de
�Zddd�Zeee�G dd� de��ZdS )z
Test ssh/channel.py.
� )�skipIf)�verifyObject)�channel)�SSHTransportAddress)�
SSHService)�SSHServerTransport)�
interfaces)�IPv4Address)�StringTransport� zConch SSH not supported.)�TestCasec @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� ZdS )
�MockConnectiona�
A mock for twisted.conch.ssh.connection.SSHConnection. Record the data
that channels send, and when they try to close the connection.
@ivar data: a L{dict} mapping channel id #s to lists of data sent by that
channel.
@ivar extData: a L{dict} mapping channel id #s to lists of 2-tuples
(extended data type, data) sent by that channel.
@ivar closes: a L{dict} mapping channel id #s to True if that channel sent
a close message.
c C s i | _ i | _i | _d S )N)�data�extData�closes��self� r �A/usr/lib/python3/dist-packages/twisted/conch/test/test_channel.py�__init__* s
zMockConnection.__init__c C s dS )z,
Return our logging prefix.
r
r r r r r � logPrefix/ s zMockConnection.logPrefixc C s | j �|g ��|� dS )z'
Record the sent data.
N)r �
setdefault�append)r r r r r r �sendData5 � zMockConnection.sendDatac C s | j �|g ��||f� dS )z0
Record the sent extended data.
N)r r r )r r �typer r r r �sendExtendedData; s zMockConnection.sendExtendedDatac C s d| j |<