%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/words/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/words/test/__pycache__/test_tap.cpython-312.pyc

�

Ϫ�fl	��z�ddlmZddlmZmZddlmZddlmZddl	m
Z
ddlmZGd�de
j�Zy	)
�)�annotations)�credentials�error)�FilePasswordDB)�defer)�unittest)�tapc��eZdZdZdZejdd�Zejdd�Zd
d�Z	d
d�Z
d
d�Zd
d	�Zd
d
�Z
dd�Zy)�
WordsTapTestsz7
    Ensures that the twisted.words.tap API works.
    sadmin:admin
joe:foo
sadminsjoesbarc���|j�|_t|jd�|_|jj	|j
�|jj
�y)z/
        Create a file with two users.
        �wbN)�mktemp�filename�open�file�write�PASSWD_TEXT�flush��selfs �=/usr/lib/python3/dist-packages/twisted/words/test/test_tap.py�setUpzWordsTapTests.setUpsG�����
��
������-��	��	�	����(�(�)��	�	����c�8�|jj�y)z0
        Close the dummy user database.
        N)r�closers r�tearDownzWordsTapTests.tearDowns��	
�	�	���rc�|�tj�}|jddg�|j|dd�y)zM
        Tests that the --hostname parameter gets passed to Options.
        z
--hostname�myhost�hostnameN)r	�Options�parseOptions�assertEqual�r�opts  r�
test_hostnamezWordsTapTests.test_hostname%s6���k�k�m�����,��1�2�����Z��(�3rc��tj�}|jd|jjg�|j|�y)zI
        Tests the --passwd command for backwards-compatibility.
        z--passwdN�r	r r!r�name�
_loginTestr#s  r�test_passwdzWordsTapTests.test_passwd-s6���k�k�m�����*�d�i�i�n�n�5�6�����rc��tj�}|jdd|jjzg�|j|�y)zD
        Tests that the --auth command generates a checker.
        z--authzfile:Nr'r#s  r�	test_authzWordsTapTests.test_auth5s;���k�k�m�����(�G�d�i�i�n�n�$<�=�>�����rc�"���jt|d�d�|dd}�j|j�j�t
j�d�fd�}|j�j�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}.
        �credCheckers�rc�R���j|�jj�y)N)r"�admin�username)r2rs �r�
_gotAvatarz,WordsTapTests._loginTest.<locals>._gotAvatarKs������X�t�z�z�':�':�;r)r2zbytes | tuple[()]�return�None)	r"�len�
assertFailure�requestAvatarId�joeWrongr�UnauthorizedLoginr1�addCallback)rr$�checkerr3s`   rr)zWordsTapTests._loginTest=s}���	
����S��0�1�1�5�"%�n�"5�a�"8������#�#�D�M�M�2�E�4K�4K�	
�	<��&�&�t�z�z�2�>�>�z�J�JrN)r4r5)r$ztap.Optionsr4zdefer.Deferred[None])�__name__�
__module__�__qualname__�__doc__rr�UsernamePasswordr1r9rrr%r*r,r)�rrrr
sU���,�K�(�K�(�(��8�<�E�+�{�+�+�F�F�;�H���4���KrrN)�
__future__r�twisted.credrr�twisted.cred.checkersr�twisted.internetr�
twisted.trialr�
twisted.wordsr	�TestCaserrBrr�<module>rJs/��#�+�0�"�"��AK�H�%�%�AKr

Zerion Mini Shell 1.0