
    Yf                     n    d Z ddlmZmZmZ ddlmZ ddlmZ  G d de          Z	 G d de          Z
d	S )
z<
Tests for basic constructs of L{twisted.cred.credentials}.
    )IUsernameHashedPasswordIUsernamePasswordUsernamePassword)_uhpVersion)TestCasec                   2    e Zd ZdZddZddZddZddZdS )	UsernamePasswordTestsz(
    Tests for L{UsernamePassword}.
    returnNc                     t          dd          }|                     |j        d           |                     |j        d           dS )zo
        The initialisation of L{UsernamePassword} will set C{username} and
        C{password} on it.
           foo   barN)r   assertEqualusernamepasswordselfcredss     S/var/www/html/env/lib/python3.11/site-packages/twisted/cred/test/test_simpleauth.pytest_initialisationz)UsernamePasswordTests.test_initialisation   sI    
 !0000000000    c                 v    t          dd          }|                     |                    d                     dS )z
        Calling C{checkPassword} on a L{UsernamePassword} will return L{True}
        when the password given is the password on the object.
           user   passN)r   
assertTruecheckPasswordr   s     r   test_correctPasswordz*UsernamePasswordTests.test_correctPassword    s9    
 !'22++G4455555r   c                 v    t          dd          }|                     |                    d                     dS )z
        Calling C{checkPassword} on a L{UsernamePassword} will return L{False}
        when the password given is NOT the password on the object.
        r   r      someotherpassN)r   assertFalser   r   s     r   test_wrongPasswordz(UsernamePasswordTests.test_wrongPassword(   s<    
 !'22,,-=>>?????r   c                 ^    |                      t          j        t                               dS )zF
        L{UsernamePassword} implements L{IUsernamePassword}.
        N)r   r   implementedByr   )r   s    r   test_interfacez$UsernamePasswordTests.test_interface0   s)     	)78HIIJJJJJr   r
   N__name__
__module____qualname____doc__r   r   r    r#    r   r   r	   r	      sx         1 1 1 16 6 6 6@ @ @ @K K K K K Kr   r	   c                   2    e Zd ZdZddZddZddZddZdS )	UsernameHashedPasswordTestsz.
    Tests for L{UsernameHashedPassword}.
    r
   Nc                     |                      ddt                    } |dd          }|                     |j        d           |                     |j        d           dS )zs
        The initialisation of L{UsernameHashedPassword} will set C{username}
        and C{hashed} on it.
        twisted.cred.credentialsUsernameHashedPasswordr   r   N)getDeprecatedModuleAttributer   r   r   hashedr   r/   r   s      r   r   z/UsernameHashedPasswordTests.test_initialisation<   sl    
 "&!B!B&(@+"
 "
 '&vv66000v.....r   c                     |                      ddt                    } |dd          }|                     |                    d                     dS )z
        Calling C{checkPassword} on a L{UsernameHashedPassword} will return
        L{True} when the password given is the password on the object.
        r.   r/   r   r   N)r0   r   r   r   r2   s      r   r   z0UsernameHashedPasswordTests.test_correctPasswordH   s\    
 "&!B!B&(@+"
 "
 '&w88++G4455555r   c                     |                      ddt                    } |dd          }|                     |                    d                     dS )z
        Calling C{checkPassword} on a L{UsernameHashedPassword} will return
        L{False} when the password given is NOT the password on the object.
        r.   r/   r   r   r   N)r0   r   r   r   r2   s      r   r    z.UsernameHashedPasswordTests.test_wrongPasswordS   s_    
 "&!B!B&(@+"
 "
 '&w88,,-=>>?????r   c                     |                      ddt                    }|                     t          j        |                     dS )zR
        L{UsernameHashedPassword} implements L{IUsernameHashedPassword}.
        r.   r/   N)r0   r   r   r   r"   )r   r/   s     r   r#   z*UsernameHashedPasswordTests.test_interface^   sI     "&!B!B&(@+"
 "
 	/=>TUUVVVVVr   r$   r%   r*   r   r   r,   r,   7   sx         
/ 
/ 
/ 
/	6 	6 	6 	6	@ 	@ 	@ 	@W W W W W Wr   r,   N)r)   twisted.cred.credentialsr   r   r   twisted.cred.test.test_credr   twisted.trial.unittestr   r	   r,   r*   r   r   <module>r9      s    
         
 4 3 3 3 3 3 + + + + + +"K "K "K "K "KH "K "K "KJ.W .W .W .W .W( .W .W .W .W .Wr   