ó
    ×›‘hl	  ã                  óz   • S SK Jr  S SKJrJr  S SKJr  S SKJr  S SK	J
r
  S SKJr   " S S\
R                  5      rg	)
é    )Úannotations)ÚcredentialsÚerror)ÚFilePasswordDB)Údefer)Úunittest)Útapc                  ó¤   • \ rS rSrSrSr\R                  " SS5      r\R                  " SS5      r	SS jr
SS jrSS	 jrSS
 jrSS jrSS jrSrg)ÚWordsTapTestsé   z/
Ensures that the twisted.words.tap API works.
s   admin:admin
joe:foo
s   admins   joes   barc                óâ   • U R                  5       U l        [        U R                  S5      U l        U R                  R	                  U R
                  5        U R                  R                  5         g)z
Create a file with two users.
ÚwbN)ÚmktempÚfilenameÚopenÚfileÚwriteÚPASSWD_TEXTÚflush©Úselfs    Ú_C:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/words/test/test_tap.pyÚsetUpÚWordsTapTests.setUp   sG   € ð Ÿ™›ˆŒÜ˜Ÿ™¨Ó-ˆŒ	Ø�	‰	�‰˜×(Ñ(Ô)Ø�	‰	�‰Õó    c                ó8   • U R                   R                  5         g)z 
Close the dummy user database.
N)r   Úcloser   s    r   ÚtearDownÚWordsTapTests.tearDown   s   € ð 	�	‰	�‰Õr   c                ó~   • [         R                  " 5       nUR                  SS/5        U R                  US   S5        g)z=
Tests that the --hostname parameter gets passed to Options.
z
--hostnameÚmyhostÚhostnameN)r	   ÚOptionsÚparseOptionsÚassertEqual©r   Úopts     r   Útest_hostnameÚWordsTapTests.test_hostname%   s6   € ô �kŠk‹mˆØ×Ñ˜,¨Ð1Ô2Ø×Ñ˜˜Z™¨(Õ3r   c                óž   • [         R                  " 5       nUR                  SU R                  R                  /5        U R                  U5        g)z9
Tests the --passwd command for backwards-compatibility.
z--passwdN©r	   r#   r$   r   ÚnameÚ
_loginTestr&   s     r   Útest_passwdÚWordsTapTests.test_passwd-   s6   € ô �kŠk‹mˆØ×Ñ˜* d§i¡i§n¡nÐ5Ô6Ø�‰˜Õr   c                ó¤   • [         R                  " 5       nUR                  SSU R                  R                  -   /5        U R                  U5        g)z4
Tests that the --auth command generates a checker.
z--authzfile:Nr+   r&   s     r   Ú	test_authÚWordsTapTests.test_auth5   s;   € ô �kŠk‹mˆØ×Ñ˜( G¨d¯i©i¯n©nÑ$<Ð=Ô>Ø�‰˜Õr   c                ó&  ^ • T R                  [        US   5      S5        US   S   nT R                  UR                  T R                  5      [
        R                  5        SU 4S jjnUR                  T R                  5      R                  U5      $ )z½
This method executes both positive and negative authentication
tests against whatever credentials checker has been stored in
the Options class.

@param opt: An instance of L{tap.Options}.
ÚcredCheckersé   r   c                óR   >• TR                  U TR                  R                  5        g )N)r%   ÚadminÚusername)r8   r   s    €r   Ú
_gotAvatarÚ,WordsTapTests._loginTest.<locals>._gotAvatarK   s   ø€ Ø×Ñ˜X t§z¡z×':Ñ':Õ;r   )r8   zbytes | tuple[()]ÚreturnÚNone)	r%   ÚlenÚassertFailureÚrequestAvatarIdÚjoeWrongr   ÚUnauthorizedLoginr7   ÚaddCallback)r   r'   Úcheckerr9   s   `   r   r-   ÚWordsTapTests._loginTest=   s}   ø€ ð 	×Ñœ˜S Ñ0Ó1°1Ô5Ø"% nÑ"5°aÑ"8ˆØ×ÑØ×#Ñ# D§M¡MÓ2´E×4KÑ4Kô	
÷	<ð ×&Ñ& t§z¡zÓ2×>Ñ>¸zÓJÐJr   )r   r   N)r;   r<   )r'   ztap.Optionsr;   zdefer.Deferred[None])Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   ÚUsernamePasswordr7   r@   r   r   r(   r.   r1   r-   Ú__static_attributes__© r   r   r   r      sQ   † ñð ,€KØ×(Ò(¨°8Ó<€EØ×+Ò+¨F°FÓ;€Hôôô4ôô÷Kr   r   N)Ú
__future__r   Útwisted.credr   r   Útwisted.cred.checkersr   Útwisted.internetr   Útwisted.trialr   Útwisted.wordsr	   ÚTestCaser   rL   r   r   Ú<module>rT      s/   ðõ #ç +Ý 0Ý "Ý "Ý ôAK�H×%Ñ%õ AKr   