o
    ¯b¸  ã                   @   s0   d Z ddlmZ ddlmZ G dd„ deƒZdS )zY
Tests for L{twisted.internet.abstract}, a collection of APIs for implementing
reactors.
é    )ÚisIPv6Address)ÚSynchronousTestCasec                   @   s@   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	dS )ÚIPv6AddressTestszw
    Tests for L{isIPv6Address}, a function for determining if a particular
    string is an IPv6 address literal.
    c                 C   ó   |   tdƒ¡ dS )zB
        The empty string is not an IPv6 address literal.
        Ú N©ÚassertFalser   ©Úself© r   úE/usr/lib/python3/dist-packages/twisted/internet/test/test_abstract.pyÚ
test_empty   ó   zIPv6AddressTests.test_emptyc                 C   r   )zA
        A single C{":"} is not an IPv6 address literal.
        ú:Nr   r	   r   r   r   Ú
test_colon   r   zIPv6AddressTests.test_colonc                 C   r   )z@
        C{"::1"} is the IPv6 loopback address literal.
        z::1N©Ú
assertTruer   r	   r   r   r   Útest_loopback    r   zIPv6AddressTests.test_loopbackc                 C   ó.   |   tdƒ¡ |   tdƒ¡ |   tdƒ¡ dS )z†
        An otherwise valid IPv6 address literal may also include a C{"%"}
        followed by an arbitrary scope identifier.
        zfe80::1%eth0ú	fe80::2%1zfe80::3%en2Nr   r	   r   r   r   Útest_scopeID&   ó   zIPv6AddressTests.test_scopeIDc                 C   r   )zv
        An otherwise invalid IPv6 address literal is still invalid with a
        trailing scope identifier.
        z%eth0z:%eth0ú
hello%eth0Nr   r	   r   r   r   Útest_invalidWithScopeID/   r   z(IPv6AddressTests.test_invalidWithScopeIDc                 C   sJ   |   tdƒ¡ |   tdƒ¡ |  tdƒ¡ |  tdƒ¡ |  tdƒ¡ dS )zQ
        L{isIPv6Address} evaluates ASCII-encoded bytes as well as text.
        s	   fe80::2%1r   u   äŒ¡r   s
   hello%eth0N)r   r   r   r	   r   r   r   Útest_unicodeAndBytes8   s
   z%IPv6AddressTests.test_unicodeAndBytesN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r   r   r      s    		r   N)r   Útwisted.internet.abstractr   Útwisted.trial.unittestr   r   r   r   r   r   Ú<module>   s   