
    Vh                     V    d Z ddlmZ ddlmZ ddlmZ  G d dej                        Zy)z(
Tests for L{twisted.protocols.finger}.
    )StringTransport)finger)unittestc                   8    e Zd ZdZddZddZddZddZddZy)	FingerTestsz%
    Tests for L{finger.Finger}.
    Nc                     t               | _        t        j                         | _        | j                  j                  | j                         y)zA
        Create and connect a L{finger.Finger} instance.
        N)r   	transportr   FingerprotocolmakeConnectionselfs    H/home/dcms/DCMS/lib/python3.12/site-packages/twisted/test/test_finger.pysetUpzFingerTests.setUp   s1     )*$$T^^4    c                     | j                   j                  d       | j                  | j                  j	                         d       y)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   dataReceivedassertEqualr	   valuer   s    r   test_simplezFingerTests.test_simple   s4    
 	""=1--/1QRr   c                     | j                   j                  d       | j                  | j                  j	                         d       y)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   s    r   test_simpleWzFingerTests.test_simpleW"   s5    
 	""#34--/1QRr   c                     | j                   j                  d       | j                  | j                  j	                         d       y)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   s    r   test_forwardingzFingerTests.test_forwarding*   s5    
 	""#<=--/1VWr   c                     | j                   j                  d       | j                  | j                  j	                         d       y)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   s    r   	test_listzFingerTests.test_list2   s4    
 	""7+--/1OPr   )returnN)	__name__
__module____qualname____doc__r   r   r   r   r    r   r   r   r      s$    5SSXQr   r   N)	r#   twisted.internet.testingr   twisted.protocolsr   twisted.trialr   TestCaser   r$   r   r   <module>r)      s)    5 $ "+Q(## +Qr   