Current File : //proc/self/root/lib/python3/dist-packages/twisted/words/test/__pycache__/test_tap.cpython-312.pyc |
�
Ϫ�fl � �z � d dl mZ d dlmZmZ d dlmZ d dlmZ d dl m
Z
d dlmZ G d� de
j � Zy )
� )�annotations)�credentials�error)�FilePasswordDB)�defer)�unittest)�tapc � � e Zd ZdZdZ ej dd� Z ej dd� Zd
d�Z d
d�Z
d
d�Zd
d �Zd
d
�Z
dd�Zy)�
WordsTapTestsz7
Ensures that the twisted.words.tap API works.
s admin:admin
joe:foo
s admins joes barc �� � | j � | _ t | j d� | _ | j j | j
� | j j
� 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.setUp sG � � ���
��
������-�� �� � ����(�(�)�� � ���� c �8 � | j j � y)z0
Close the dummy user database.
N)r �closer s r �tearDownzWordsTapTests.tearDown s � �
� � ���r c �| � t j � }|j ddg� | j |d d� 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��(�3r c � � t j � }|j d| j j g� | 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�����r c � � t j � }|j dd| j j z g� | j |� y)zD
Tests that the --auth command generates a checker.
z--authzfile:Nr'