HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/words/test/__pycache__/test_tap.cpython-38.pyc
U


W[��@s>ddlmZmZddlmZddlmZGdd�dej�ZdS)�)�credentials�error)�tap)�unittestc@s\eZdZdZdZe�dd�Ze�dd�Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dd�ZdS)�
WordsTapTestsz7
    Ensures that the twisted.words.tap API works.
    sadmin:admin
joe:foo
sadminsjoesbarcCs4|��|_t|jd�|_|j�|j�|j��dS)z/
        Create a file with two users.
        �wbN)Zmktemp�filename�open�file�write�PASSWD_TEXT�flush��self�r�=/usr/lib/python3/dist-packages/twisted/words/test/test_tap.py�setUps
zWordsTapTests.setUpcCs|j��dS)z0
        Close the dummy user database.
        N)r
�closerrrr�tearDownszWordsTapTests.tearDowncCs*t��}|�ddg�|�|dd�dS)zM
        Tests that the --hostname parameter gets passed to Options.
        z
--hostnameZmyhostZhostnameN)r�Options�parseOptions�assertEqual�r�optrrr�
test_hostname%szWordsTapTests.test_hostnamecCs(t��}|�d|jjg�|�|�dS)zI
        Tests the --passwd command for backwards-compatibility.
        z--passwdN�rrrr
�name�
_loginTestrrrr�test_passwd.szWordsTapTests.test_passwdcCs,t��}|�dd|jjg�|�|�dS)zD
        Tests that the --auth command generates a checker.
        z--authzfile:Nrrrrr�	test_auth7szWordsTapTests.test_authcsT��t|d�d�|dd}��|��j�tj��fdd�}|��j��|�S)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}.
        ZcredCheckers�rcs��|�jj�dS)N)r�admin�username)r"rrr�
_gotAvatarLsz,WordsTapTests._loginTest.<locals>._gotAvatar)	r�lenZ
assertFailureZrequestAvatarId�joeWrongrZUnauthorizedLoginr!ZaddCallback)rrZcheckerr#rrrr@s�zWordsTapTests._loginTestN)�__name__�
__module__�__qualname__�__doc__rrZUsernamePasswordr!r%rrrrrrrrrrr
s
			rN)	Ztwisted.credrrZ
twisted.wordsrZ
twisted.trialrZTestCaserrrrr�<module>s