Ϫf `dZddlmZmZmZddlmZddlmZGddeZ GddeZ y ) z< Tests for basic constructs of L{twisted.cred.credentials}. )IUsernameHashedPasswordIUsernamePasswordUsernamePassword) _uhpVersion)TestCasec0eZdZdZddZddZddZddZy)UsernamePasswordTestsz( Tests for L{UsernamePassword}. Nctdd}|j|jd|j|jdy)zo The initialisation of L{UsernamePassword} will set C{username} and C{password} on it. foobarN)r assertEqualusernamepasswordselfcredss C/usr/lib/python3/dist-packages/twisted/cred/test/test_simpleauth.pytest_initialisationz)UsernamePasswordTests.test_initialisations8 !0 0 0c\tdd}|j|jdy)z Calling C{checkPassword} on a L{UsernamePassword} will return L{True} when the password given is the password on the object. userpassN)r assertTrue checkPasswordrs rtest_correctPasswordz*UsernamePasswordTests.test_correctPassword s' !'2 ++G45rc\tdd}|j|jdy)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 assertFalserrs rtest_wrongPasswordz(UsernamePasswordTests.test_wrongPassword(s* !'2 ,,-=>?rcT|jtjty)zF L{UsernamePassword} implements L{IUsernamePassword}. N)rr implementedByr)rs rtest_interfacez$UsernamePasswordTests.test_interface0s )778HIJrreturnN__name__ __module__ __qualname____doc__rrrr"rrr r s16@Krr c0eZdZdZddZddZddZddZy)UsernameHashedPasswordTestsz. Tests for L{UsernameHashedPassword}. Nc|jddt}|dd}|j|jd|j|jdy)zs The initialisation of L{UsernameHashedPassword} will set C{username} and C{hashed} on it. twisted.cred.credentialsUsernameHashedPasswordr r N)getDeprecatedModuleAttributerr rhashedrr/rs rrz/UsernameHashedPasswordTests.test_initialisation<sS "&!B!B &(@+" 'vv6 0 v.rc|jddt}|dd}|j|jdy)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)r0rrrr2s rrz0UsernameHashedPasswordTests.test_correctPasswordHsB "&!B!B &(@+" 'w8 ++G45rc|jddt}|dd}|j|jdy)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)r0rrrr2s rrz.UsernameHashedPasswordTests.test_wrongPasswordSsE "&!B!B &(@+" 'w8 ,,-=>?rcz|jddt}|jtj|y)zR L{UsernameHashedPassword} implements L{IUsernameHashedPassword}. r.r/N)r0rrrr!)rr/s rr"z*UsernameHashedPasswordTests.test_interface^s8"&!B!B &(@+"  /==>TUVrr#r%r*rrr,r,7s / 6 @Wrr,N) r)twisted.cred.credentialsrrrtwisted.cred.test.test_credrtwisted.trial.unittestrr r,r*rrr9s9  4+"KH"KJ.W(.Wr