File: //lib/python3/dist-packages/twisted/test/__pycache__/test_ftp_options.cpython-312.pyc
�
Ϫ�f�
� �^ � d Z ddlmZmZ ddlmZ ddlmZ ddlm Z ddl
mZ G d� de� Zy )
z
Tests for L{twisted.tap.ftp}.
� )�credentials�error)�versions)�FilePath)�Options)�TestCasec �8 � e Zd ZdZdZd d�Zd d�Zd d�Zd� Zd� Z y)
�FTPOptionsTestszJ
Tests for the command line option parser used for C{twistd ftp}.
)s iamusers thisispasswordNc �� � | j � | _ t | j � }|j dj | j
� � t
� | _ y)z/
Create a file with two users.
� :N)�mktemp�filenamer �
setContent�join�usernamePasswordr �options)�self�fs �?/usr/lib/python3/dist-packages/twisted/test/test_ftp_options.py�setUpzFTPOptionsTests.setUp sC � � ���
��
��T�]�]�#�� ���T�Y�Y�t�4�4�5�6��y��� c � � | j t j dddd� | j j | j
� y)zs
The C{--password-file} option will emit a warning stating that
said option is deprecated.
�Twisted� � r N)�callDeprecatedr �Versionr �opt_password_filer )r s r �test_passwordfileDeprecationz,FTPOptionsTests.test_passwordfileDeprecation s: � �
������Y��A�q�1��L�L�*�*��M�M�
r c �� � t | j d � }| j j dd| j z g� | j t | j d � |dz � y)zf
The C{--auth} command-line option will add a checker to the list of
checkers
�credCheckers�--auth�file:r N)�lenr �parseOptionsr �assertEqual)r �numCheckerss r �test_authAddedzFTPOptionsTests.test_authAdded* sY � �
�$�,�,�~�6�7�����!�!�8�W�t�}�}�-D�"E�F�����T�\�\�.�9�:�K�!�O�Lr c � � � � j j dd� j z g� � j d d }t j � j
d d� }|j
|� j � fd�d� � S ) z�
The checker created by the C{--auth} command-line option returns a
L{Deferred} that fails with L{UnauthorizedLogin} when
presented with credentials that are unknown to that checker.
r"