%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/conch/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/conch/test/__pycache__/test_forwarding.cpython-312.pyc

�

Ϫ�f����dZddlmZed�ZerddlmZddlmZddlm	Z	ddl
mZmZddl
mZGd	�d
ej�Zy)z,
Tests for L{twisted.conch.ssh.forwarding}.
�)�
requireModule�cryptography)�
forwarding)�IPv6Address)�deterministicResolvingReactor)�MemoryReactorClock�StringTransport)�unittestc�0�eZdZdZesdZdeddfd�Zdd�Zy)	�TestSSHConnectForwardingChannelzH
    Unit and integration tests for L{SSHConnectForwardingChannel}.
    zCannot run without cryptography�reactor�returnNc��|jdd}|jd}|jd�}t|j	���}|j|�y)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)�selfr
�factory�	connector�protocol�	transports      �D/usr/lib/python3/dist-packages/twisted/conch/test/test_forwarding.py�makeTCPConnectionz1TestSSHConnectForwardingChannel.makeTCPConnectionsZ���$�$�Q�'��*���&�&�q�)�	��(�(��.��#�	�0H�0H�0J�K�	����	�*�c��tjd��}t�}t|dg�|_|jd�|j
|�|j|j�|j|jtj�|jtddd�|jjj��y)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�
memoryReactors   r� test_channelOpenHostnameRequestsz@TestSSHConnectForwardingChannel.test_channelOpenHostnameRequests+s���
�4�4�>W�X��*�,�
�4�]�U�G�L�����������}�-����S�5�5�6�	
���c�j�j�*�*H�*H�I������u�d�+�S�Z�Z�-A�-A�-I�-I�-K�	
r)rN)	�__name__�
__module__�__qualname__�__doc__r�skiprrr/�rrrrs*����0��+�);�+��+�
rrN)r3�twisted.python.reflectrr�twisted.conch.sshr�twisted.internet.addressr�$twisted.internet.test.test_endpointsr�twisted.internet.testingrr	�
twisted.trialr
�TestCaserr5rr�<module>r=s=���
1��^�,���,�0�N�H�"�(
�h�&7�&7�(
r

Zerion Mini Shell 1.0