File: //usr/lib/python3/dist-packages/twisted/conch/test/__pycache__/test_channel.cpython-38.pyc
U
W[C/ � @ s� d Z ddlmZmZ ddlmZ z\ddlmZ ddlm Z ddl
mZ ddlm
Z
ddlmZ dd lmZ dd
lmZ dZW n ek
r� dZeZ
Y nX dd
lmZ ddlmZ G dd� de
�Zddd�ZG dd� dej�ZdS )z
Test ssh/channel.py.
� )�division�absolute_import)�verifyObject)�channel)�SSHTransportAddress)�SSHServerTransport)�
SSHService)�
interfaces)�IPv4Address)�StringTransportNzConch SSH not supported.)�unittest)�
intToBytesc @ 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 �sendData6 s 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 |<