+
    Dfj
                     `    R t ^ RIHtHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht  ! R R]4      tR# )	z
Tests for L{twisted.tap.ftp}.
)credentialserror)versions)FilePath)Options)TestCasec                   j   a  ] tR t^t o RtRtV 3R lR ltV 3R lR ltV 3R lR ltR t	R	 t
R
tV tR# )FTPOptionsTestszB
Tests for the command line option parser used for C{twistd ftp}.
c                   < V ^8  d   QhRR/#    returnN )format__classdict__s   "?/usr/lib/python3/dist-packages/twisted/test/test_ftp_options.py__annotate__FTPOptionsTests.__annotate__   s     ! !t !    c                    V P                  4       V n        \        V P                  4      pVP                  RP	                  V P
                  4      4       \        4       V n        R# )z
Create a file with two users.
   :N)mktempfilenamer   
setContentjoinusernamePasswordr   options)selffs   & r   setUpFTPOptionsTests.setUp   sC     T]]#	TYYt4456yr   c                   < V ^8  d   QhRR/# r   r   )r   r   s   "r   r   r      s     	
 	
d 	
r   c                    V P                  \        P                  ! R^^^ 4      V P                  P                  V P
                  4       R# )z[
The C{--password-file} option will emit a warning stating that
said option is deprecated.
TwistedN)callDeprecatedr   Versionr   opt_password_filer   )r   s   &r   test_passwordfileDeprecation,FTPOptionsTests.test_passwordfileDeprecation   s:    
 	YAq1LL**MM	
r   c                   < V ^8  d   QhRR/# r   r   )r   r   s   "r   r   r   *   s     M M Mr   c                    \        V P                  R,          4      pV P                  P                  RRV P                  ,           .4       V P	                  \        V P                  R,          4      V^,           4       R# )zN
The C{--auth} command-line option will add a checker to the list of
checkers
credCheckers--authfile:N)lenr   parseOptionsr   assertEqual)r   numCheckerss   & r   test_authAddedFTPOptionsTests.test_authAdded*   sY    
 $,,~67!!8Wt}}-D"EFT\\.9:K!OLr   c                0  a  S P                   P                  RRS P                  ,           .4       S P                   R,          R,          p\        P                  ! S P
                  ^ ,          R4      pVP                  V4      P                  V 3R lR 4      # )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+   fakec                 &   < SP                  R 4      # )z!Wrong password should raise error)fail)ignorer   s   &r   <lambda>2FTPOptionsTests.test_authFailure.<locals>.<lambda>=   s    499%HIr   c                 @    V P                  \        P                  4      # N)trapr   UnauthorizedLogin)errs   &r   r9   r:   >   s    !8!89r   )r   r/   r   r   UsernamePasswordr   requestAvatarIdaddCallbacks)r   checkerinvalids   f  r   test_authFailure FTPOptionsTests.test_authFailure3   sy     	!!8Wt}}-D"EF,,~.r2..t/D/DQ/GP&&w/<<I9
 	
r   c                  a a S P                   P                  RRS P                  ,           .4       S P                   R,          R,          p\        P                  ! S P
                  !  oVP                  S4      P                  VV 3R l4      # )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+   c                 <   < SP                  V SP                  4      # r<   )r0   username)rJ   correctr   s   &r   r9   2FTPOptionsTests.test_authSuccess.<locals>.<lambda>K   s    T--h8H8HIr   r@   )r   r/   r   r   rA   r   rB   addCallback)r   rD   rK   s   f @r   test_authSuccess FTPOptionsTests.test_authSuccessA   so     	!!8Wt}}-D"EF,,~.r2..0E0EF&&w/;;I
 	
r   )r   r   N)s   iamusers   thisispassword)__name__
__module____qualname____firstlineno____doc__r   r   r'   r2   rF   rN   __static_attributes____classdictcell__)r   s   @r   r	   r	      sA      7! !	
 	
M M

 
r   r	   N)rT   twisted.credr   r   twisted.pythonr   twisted.python.filepathr   twisted.tap.ftpr   twisted.trial.unittestr   r	   r   r   r   <module>r\      s'    , # , # +=
h =
r   