HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/conch/test/__pycache__/test_forwarding.cpython-38.pyc
U


W[��@s�dZddlmZmZddlmZed�Zer8ddlmZddl	m
Z
ddlmZddl
mZdd	lmZmZGd
d�dej�ZdS)
z,
Tests for L{twisted.conch.ssh.forwarding}.
�)�division�absolute_import)�
requireModule�cryptography)�
forwarding)�IPv6Address)�unittest)�deterministicResolvingReactor)�MemoryReactorClock�StringTransportc@s(eZdZdZesdZdd�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)ZpeerAddress)Z
tcpClientsZ
connectorsZ
buildProtocolrZgetDestinationZmakeConnection)�selfZreactor�factoryZ	connectorZprotocol�	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��)Zhostportz::1NZTCPr)rZSSHConnectForwardingChannelr
r	Z_reactorZchannelOpenrZsuccessResultOfZ_channelOpenDeferredZassertIsInstanceZclientZSSHForwardingClientZassertEqualrrZgetPeer)rZsutZ
memoryReactorrrr� test_channelOpenHostnameRequests-s�



�z@TestSSHConnectForwardingChannel.test_channelOpenHostnameRequestsN)�__name__�
__module__�__qualname__�__doc__r�skiprrrrrrrs
rN)rZ
__future__rrZtwisted.python.reflectrrZtwisted.conch.sshrZtwisted.internet.addressrZ
twisted.trialrZ$twisted.internet.test.test_endpointsr	Ztwisted.test.proto_helpersr
rZTestCaserrrrr�<module>s