Ë
    ojÛ  ã                   ó`   — 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
y	)
z<
Tests for basic constructs of L{twisted.cred.credentials}.
é    )ÚIUsernameHashedPasswordÚIUsernamePasswordÚUsernamePassword)Ú_uhpVersion)ÚTestCasec                   ó0   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zy)ÚUsernamePasswordTestsz(
    Tests for L{UsernamePassword}.
    Nc                 óŒ   — t        dd«      }| j                  |j                  d«       | j                  |j                  d«       y)zo
        The initialisation of L{UsernamePassword} will set C{username} and
        C{password} on it.
        ó   fooó   barN)r   ÚassertEqualÚusernameÚpassword©ÚselfÚcredss     úC/usr/lib/python3/dist-packages/twisted/cred/test/test_simpleauth.pyÚtest_initialisationz)UsernamePasswordTests.test_initialisation   s8   € ô
 ! ¨Ó0ˆØ×Ñ˜Ÿ™¨Ô0Ø×Ñ˜Ÿ™¨Õ0ó    c                 ó\   — t        dd«      }| j                  |j                  d«      «       y)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    s'   € ô
 ! ¨'Ó2ˆØ�‰˜×+Ñ+¨GÓ4Õ5r   c                 ó\   — t        dd«      }| j                  |j                  d«      «       y)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ˆØ×Ñ˜×,Ñ,Ð-=Ó>Õ?r   c                 óT   — | j                  t        j                  t        «      «       y)zF
        L{UsernamePassword} implements L{IUsernamePassword}.
        N)r   r   ÚimplementedByr   )r   s    r   Útest_interfacez$UsernamePasswordTests.test_interface0   s   € ð 	�‰Ô)×7Ñ7Ô8HÓIÕJr   ©ÚreturnN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r"   © r   r   r	   r	      s   „ ñó1ó6ó@ôKr   r	   c                   ó0   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zy)ÚUsernameHashedPasswordTestsz.
    Tests for L{UsernameHashedPassword}.
    Nc                 ó´   — | j                  ddt        «      } |dd«      }| j                  |j                  d«       | j                  |j                  d«       y)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<   sS   € ð
 "&×!BÑ!BØ&Ð(@Ä+ó"
Ðñ ' v¨vÓ6ˆØ×Ñ˜Ÿ™¨Ô0Ø×Ñ˜Ÿ™ vÕ.r   c                 ó„   — | j                  ddt        «      } |dd«      }| j                  |j                  d«      «       y)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   sB   € ð
 "&×!BÑ!BØ&Ð(@Ä+ó"
Ðñ ' w°Ó8ˆØ�‰˜×+Ñ+¨GÓ4Õ5r   c                 ó„   — | j                  ddt        «      } |dd«      }| j                  |j                  d«      «       y)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   sE   € ð
 "&×!BÑ!BØ&Ð(@Ä+ó"
Ðñ ' w°Ó8ˆØ×Ñ˜×,Ñ,Ð-=Ó>Õ?r   c                 óz   — | j                  ddt        «      }| j                  t        j                  |«      «       y)zR
        L{UsernameHashedPassword} implements L{IUsernameHashedPassword}.
        r.   r/   N)r0   r   r   r   r!   )r   r/   s     r   r"   z*UsernameHashedPasswordTests.test_interface^   s8   € ð "&×!BÑ!BØ&Ð(@Ä+ó"
Ðð 	�‰Ô/×=Ñ=Ð>TÓUÕVr   r#   r%   r*   r   r   r,   r,   7   s   „ ñó
/ó	6ó	@ô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      s9   ðñ÷
ñ õ
 4Ý +ô"K˜Hô "KôJ.W (õ .Wr   