HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/twisted/cred/test/__pycache__/test_simpleauth.cpython-310.pyc
o

�b�
�@sTdZddlmZmZmZddlmZddlmZGdd�de�Z	Gdd�de�Z
d	S)
z<
Tests for basic constructs of L{twisted.cred.credentials}.
�)�IUsernameHashedPassword�IUsernamePassword�UsernamePassword)�_uhpVersion)�TestCasec@�0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�UsernamePasswordTestsz(
    Tests for L{UsernamePassword}.
    cCs*tdd�}|�|jd�|�|jd�dS)zo
        The initialisation of L{UsernamePassword} will set C{username} and
        C{password} on it.
        �foo�barN)r�assertEqual�username�password��self�creds�r�C/usr/lib/python3/dist-packages/twisted/cred/test/test_simpleauth.py�test_initialisations
z)UsernamePasswordTests.test_initialisationcCstdd�}|�|�d��dS)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�
checkPasswordrrrr�test_correctPassword �
z*UsernamePasswordTests.test_correctPasswordcCstdd�}|�|�d��dS)z�
        Calling C{checkPassword} on a L{UsernamePassword} will return L{False}
        when the password given is NOT the password on the object.
        rr�
someotherpassN)r�assertFalserrrrr�test_wrongPassword(rz(UsernamePasswordTests.test_wrongPasswordcCs|�t�t��dS)zF
        L{UsernamePassword} implements L{IUsernamePassword}.
        N)rr�
implementedByr)rrrr�test_interface0sz$UsernamePasswordTests.test_interfaceN��__name__�
__module__�__qualname__�__doc__rrrrrrrrrs	rc@r)�UsernameHashedPasswordTestsz.
    Tests for L{UsernameHashedPassword}.
    cCs8|�ddt�}|dd�}|�|jd�|�|jd�dS)zs
        The initialisation of L{UsernameHashedPassword} will set C{username}
        and C{hashed} on it.
        �twisted.cred.credentials�UsernameHashedPasswordr	r
N)�getDeprecatedModuleAttributerrr�hashed�rr&rrrrr<s�
z/UsernameHashedPasswordTests.test_initialisationcCs,|�ddt�}|dd�}|�|�d��dS)z�
        Calling C{checkPassword} on a L{UsernameHashedPassword} will return
        L{True} when the password given is the password on the object.
        r%r&rrN)r'rrrr)rrrrH�
�
z0UsernameHashedPasswordTests.test_correctPasswordcCs,|�ddt�}|dd�}|�|�d��dS)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&rrrN)r'rrrr)rrrrSr*z.UsernameHashedPasswordTests.test_wrongPasswordcCs"|�ddt�}|�t�|��dS)zR
        L{UsernameHashedPassword} implements L{IUsernameHashedPassword}.
        r%r&N)r'rrrr)rr&rrrr^s�z*UsernameHashedPasswordTests.test_interfaceNrrrrrr$7sr$N)r#�twisted.cred.credentialsrrr�twisted.cred.test.test_credr�twisted.trial.unittestrrr$rrrr�<module>s%