HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/twisted/conch/test/__pycache__/test_forwarding.cpython-310.pyc
o

�br�@srdZddlmZed�ZerddlmZddlmZddlm	Z	ddl
mZmZddl
mZGd	d
�d
ej�ZdS)z,
Tests for L{twisted.conch.ssh.forwarding}.
�)�
requireModule�cryptography)�
forwarding)�IPv6Address)�deterministicResolvingReactor)�MemoryReactorClock�StringTransport)�unittestc@s(eZdZdZes
dZdd�Zdd�ZdS)�TestSSHConnectForwardingChannelzH
    Unit and integration tests for L{SSHConnectForwardingChannel}.
    zCannot run without cryptographycCs>|jdd}|jd}|�d�}t|��d�}|�|�dS)z�
        Fake that connection was established for first connectTCP request made
        on C{reactor}.

        @param reactor: Reactor on which to fake the connection.
        @type  reactor: A reactor.
        r�N)�peerAddress)�
tcpClients�
connectors�
buildProtocolr�getDestination�makeConnection)�self�reactor�factory�	connector�protocol�	transport�r�D/usr/lib/python3/dist-packages/twisted/conch/test/test_forwarding.py�makeTCPConnections


z1TestSSHConnectForwardingChannel.makeTCPConnectioncCsptjdd�}t�}t|dg�|_|�d�|�|�|�|j�|�	|j
tj�|�t
ddd�|j
j���dS)z�
        When a hostname is sent as part of forwarding requests, it
        is resolved using HostnameEndpoint's resolver.
        )zfwd.example.org��)�hostportz::1N�TCPr)r�SSHConnectForwardingChannelrr�_reactor�channelOpenr�successResultOf�_channelOpenDeferred�assertIsInstance�client�SSHForwardingClient�assertEqualrr�getPeer)r�sut�
memoryReactorrrr� test_channelOpenHostnameRequests+s

�z@TestSSHConnectForwardingChannel.test_channelOpenHostnameRequestsN)�__name__�
__module__�__qualname__�__doc__r�skiprr*rrrrr
sr
N)r.�twisted.python.reflectrr�twisted.conch.sshr�twisted.internet.addressr�$twisted.internet.test.test_endpointsr�twisted.test.proto_helpersrr�
twisted.trialr	�TestCaser
rrrr�<module>s