U
    Acj  ć                   @   s>   d Z ddlmZ ddlmZ ddlmZ G dd dejZdS )z(
Tests for L{twisted.protocols.finger}.
é    )ŚStringTransport)Śfinger)Śunittestc                   @   sV   e Zd ZdZddddZddddZdddd	Zddd
dZddddZdS )ŚFingerTestsz%
    Tests for L{finger.Finger}.
    N)Śreturnc                 C   s$   t  | _t ” | _| j | j” dS )zA
        Create and connect a L{finger.Finger} instance.
        N)r   Ś	transportr   ZFingerŚprotocolZmakeConnection©Śself© r   ś</tmp/pip-unpacked-wheel-nrvc_22y/twisted/test/test_finger.pyŚsetUp   s    
zFingerTests.setUpc                 C   s"   | j  d” |  | j ” d” dS )z
        When L{finger.Finger} receives a CR LF terminated line, it responds
        with the default user status message - that no such user exists.
        s   moshez
ó   Login: moshez
No such user
N©r   ZdataReceivedŚassertEqualr   Śvaluer	   r   r   r   Śtest_simple   s    zFingerTests.test_simplec                 C   s"   | j  d” |  | j ” d” dS )z§
        The behavior for a query which begins with C{"/w"} is the same as the
        behavior for one which does not.  The user is reported as not existing.
        s   /w moshez
r   Nr   r	   r   r   r   Śtest_simpleW"   s    zFingerTests.test_simpleWc                 C   s"   | j  d” |  | j ” d” dS )z
        When L{finger.Finger} receives a request for a remote user, it responds
        with a message rejecting the request.
        s   moshez@example.com
s!   Finger forwarding service denied
Nr   r	   r   r   r   Śtest_forwarding*   s    zFingerTests.test_forwardingc                 C   s"   | j  d” |  | j ” d” dS )z
        When L{finger.Finger} receives a blank line, it responds with a message
        rejecting the request for all online users.
        s   
s   Finger online list denied
Nr   r	   r   r   r   Ś	test_list2   s    zFingerTests.test_list)	Ś__name__Ś
__module__Ś__qualname__Ś__doc__r   r   r   r   r   r   r   r   r   r      s   r   N)	r   Ztwisted.internet.testingr   Ztwisted.protocolsr   Ztwisted.trialr   ZTestCaser   r   r   r   r   Ś<module>   s   