
    h                     V    S r SSKJr  SSKJr  SSKJr   " S S\R                  5      rg)z(
Tests for L{twisted.protocols.finger}.
    )StringTransport)finger)unittestc                   J    \ rS rSrSrS
S jrS
S jrS
S jrS
S jrS
S jr	S	r
g)FingerTests   z
Tests for L{finger.Finger}.
Nc                     [        5       U l        [        R                  " 5       U l        U R                  R                  U R                  5        g)z1
Create and connect a L{finger.Finger} instance.
N)r   	transportr   FingerprotocolmakeConnectionselfs    _/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/twisted/test/test_finger.pysetUpFingerTests.setUp   s1     )*$$T^^4    c                     U R                   R                  S5        U R                  U R                  R	                  5       S5        g)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_simpleFingerTests.test_simple   s4    
 	""=1--/1QRr   c                     U R                   R                  S5        U R                  U R                  R	                  5       S5        g)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_simpleWFingerTests.test_simpleW"   s5    
 	""#34--/1QRr   c                     U R                   R                  S5        U R                  U R                  R	                  5       S5        g)zo
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_forwardingFingerTests.test_forwarding*   s5    
 	""#<=--/1VWr   c                     U R                   R                  S5        U R                  U R                  R	                  5       S5        g)zu
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_listFingerTests.test_list2   s4    
 	""7+--/1OPr   )r   r
   )returnN)__name__
__module____qualname____firstlineno____doc__r   r   r   r    r#   __static_attributes__ 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>r1      s)    5 $ "+Q(## +Qr   