o
    Óó·iŒ  ã                   @   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                   @   sB   e Zd ZdZddd„Zddd„Zddd	„Zdd
d„Zddd„ZdS )ÚFingerTestsz%
    Tests for L{finger.Finger}.
    ÚreturnNc                 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   ú^C:\Users\psant\Downloads\PAF backend\school\venv\Lib\site-packages\twisted/test/test_finger.pyÚsetUp   s   
zFingerTests.setUpc                 C   ó"   | 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   ó   zFingerTests.test_simplec                 C   r   )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"   r   zFingerTests.test_simpleWc                 C   r   )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*   r   zFingerTests.test_forwardingc                 C   r   )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   r   zFingerTests.test_list)r   N)	Ú__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
   