U
    �Acjœ  ã                   @  sd   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ G dd	„ d	eje
ƒZd
S )z5
Tests for L{SSHTransportAddrress} in ssh/address.py
é    )Úannotations)ÚCallable)ÚSSHTransportAddress)ÚIPv4Address)ÚAddressTestCaseMixin)Úunittestc                   @  s<   e Zd ZdZdddœdd„Zddœd	d
„Zddœdd„ZdS )ÚSSHTransportAddressTestszí
    L{twisted.conch.ssh.address.SSHTransportAddress} is what Conch transports
    use to represent the other side of the SSH connection.  This tests the
    basic functionality of that class (string representation, comparison, &c).
    zCallable[[object], str]ÚNone)ÚstringFunctionÚreturnc                 C  s.   |   ¡ }||ƒ}||jƒ}|  |d| ¡ dS )z‹
        The string representation of C{SSHTransportAddress} should be
        "SSHTransportAddress(<stringFunction on address>)".
        zSSHTransportAddress(%s)N)ÚbuildAddressÚaddressÚassertEqual)Úselfr
   ÚaddrZstringValueZaddressValue© r   úC/tmp/pip-unpacked-wheel-nrvc_22y/twisted/conch/test/test_address.pyÚ_stringRepresentation   s    
z.SSHTransportAddressTests._stringRepresentationr   )r   c                 C  s   t tdddƒƒS )z”
        Create an arbitrary new C{SSHTransportAddress}.  A new instance is
        created for each call, but always for the same address.
        ÚTCPz	127.0.0.1é   ©r   r   ©r   r   r   r   r   "   s    z%SSHTransportAddressTests.buildAddressc                 C  s   t tdddƒƒS )zK
        Like C{buildAddress}, but with a different fixed address.
        r   z	127.0.0.2r   r   r   r   r   r   ÚbuildDifferentAddress)   s    z.SSHTransportAddressTests.buildDifferentAddressN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r      s   
r   N)r   Ú
__future__r   Útypingr   Ztwisted.conch.ssh.addressr   Ztwisted.internet.addressr   Z"twisted.internet.test.test_addressr   Ztwisted.trialr   ZTestCaser   r   r   r   r   Ú<module>   s   