ó
    ×›‘h˜
  ã                   ó^   • S r SSKJrJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr   " S S\5      rg	)
z
Tests for L{twisted.tap.ftp}.
é    )ÚcredentialsÚerror)Úversions)ÚFilePath)ÚOptions)ÚTestCasec                   óF   • \ rS rSrSrSrSS jrSS jrSS jrS r	S	 r
S
rg)ÚFTPOptionsTestsé   zB
Tests for the command line option parser used for C{twistd ftp}.
)s   iamusers   thisispasswordNc                 óÊ   • U R                  5       U l        [        U R                  5      nUR                  SR	                  U R
                  5      5        [        5       U l        g)z
Create a file with two users.
ó   :N)ÚmktempÚfilenamer   Ú
setContentÚjoinÚusernamePasswordr   Úoptions)ÚselfÚfs     ÚaC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/test/test_ftp_options.pyÚsetUpÚFTPOptionsTests.setUp   sC   € ð Ÿ™›ˆŒÜ�T—]‘]Ó#ˆØ	�‰�T—Y‘Y˜t×4Ñ4Ó5Ô6Ü“yˆ�ó    c                 ó”   • U R                  [        R                  " SSSS5      U R                  R                  U R
                  5        g)z[
The C{--password-file} option will emit a warning stating that
said option is deprecated.
ÚTwistedé   é   r   N)ÚcallDeprecatedr   ÚVersionr   Úopt_password_filer   )r   s    r   Útest_passwordfileDeprecationÚ,FTPOptionsTests.test_passwordfileDeprecation   s:   € ð
 	×ÑÜ×Ò˜Y¨¨A¨qÓ1Ø�L‰L×*Ñ*Ø�M‰Mõ	
r   c                 óÞ   • [        U R                  S   5      nU R                  R                  SSU R                  -   /5        U R	                  [        U R                  S   5      US-   5        g)zN
The C{--auth} command-line option will add a checker to the list of
checkers
ÚcredCheckersú--authúfile:r   N)Úlenr   ÚparseOptionsr   ÚassertEqual)r   ÚnumCheckerss     r   Útest_authAddedÚFTPOptionsTests.test_authAdded*   sY   € ô
 ˜$Ÿ,™, ~Ñ6Ó7ˆØ�‰×!Ñ! 8¨W°t·}±}Ñ-DÐ"EÔFØ×Ñœ˜TŸ\™\¨.Ñ9Ó:¸KÈ!¹OÕLr   c                 ó  ^ • T R                   R                  SST R                  -   /5        T R                   S   S   n[        R                  " T R
                  S   S5      nUR                  U5      R                  U 4S jS 5      $ )	z·
The checker created by the C{--auth} command-line option returns a
L{Deferred} that fails with L{UnauthorizedLogin} when
presented with credentials that are unknown to that checker.
r%   r&   r$   éÿÿÿÿr   Úfakec                 ó&   >• TR                  S5      $ )Nz!Wrong password should raise error)Úfail)Úignorer   s    €r   Ú<lambda>Ú2FTPOptionsTests.test_authFailure.<locals>.<lambda>=   s   ø€ ˜4Ÿ9™9Ð%HÔIr   c                 ó@   • U R                  [        R                  5      $ ©N)Útrapr   ÚUnauthorizedLogin)Úerrs    r   r3   r4   >   s   € ˜Ÿ™¤×!8Ñ!8Ô9r   )r   r(   r   r   ÚUsernamePasswordr   ÚrequestAvatarIdÚaddCallbacks)r   ÚcheckerÚinvalids   `  r   Útest_authFailureÚ FTPOptionsTests.test_authFailure3   sy   ø€ ð 	�‰×!Ñ! 8¨W°t·}±}Ñ-DÐ"EÔFØ—,‘,˜~Ñ.¨rÑ2ˆÜ×.Ò.¨t×/DÑ/DÀQÑ/GÈÓPˆØ×&Ñ& wÓ/×<Ñ<ÜIÙ9ó
ð 	
r   c                 ó  ^ ^• T R                   R                  SST R                  -   /5        T R                   S   S   n[        R                  " T R
                  6 mUR                  T5      R                  UU 4S j5      $ )z«
The checker created by the C{--auth} command-line option returns a
L{Deferred} that returns the avatar id when presented with credentials
that are known to that checker.
r%   r&   r$   r.   c                 ó<   >• TR                  U TR                  5      $ r6   )r)   Úusername)rC   Úcorrectr   s    €€r   r3   Ú2FTPOptionsTests.test_authSuccess.<locals>.<lambda>K   s   ø€ ˜T×-Ñ-¨h¸×8HÑ8HÔIr   )r   r(   r   r   r:   r   r;   ÚaddCallback)r   r=   rD   s   ` @r   Útest_authSuccessÚ FTPOptionsTests.test_authSuccessA   so   ù€ ð 	�‰×!Ñ! 8¨W°t·}±}Ñ-DÐ"EÔFØ—,‘,˜~Ñ.¨rÑ2ˆÜ×.Ò.°×0EÑ0EÐFˆØ×&Ñ& wÓ/×;Ñ;ÝIó
ð 	
r   )r   r   )ÚreturnN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r!   r+   r?   rG   Ú__static_attributes__© r   r   r
   r
      s)   † ñð 7Ðô!ô	
ôMò
õ
r   r
   N)rN   Útwisted.credr   r   Útwisted.pythonr   Útwisted.python.filepathr   Útwisted.tap.ftpr   Útwisted.trial.unittestr   r
   rP   r   r   Ú<module>rV      s'   ðñ÷ ,Ý #Ý ,Ý #Ý +ô=
�hõ =
r   