Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/conch/test/__pycache__/test_tap.cpython-39.pyc
Ðазад
a k�h� � @ s� d Z ddlmZ ddlmZ ddlmZmZmZ ddl m Z ddlmZ e d�Z e d�Ze d �Ze r�er�er�dd lmZ ddlmZ G dd � d e�ZdS )z! Tests for L{twisted.conch.tap}. � )�StreamServerEndpointService)�error)�ISSHPrivateKey�IUsernamePassword�UsernamePassword)� requireModule)�TestCase�cryptography�pyasn1ztwisted.conch.unix)�tap)�OpenSSHFactoryc @ sl e Zd ZdZesdZesdZes$dZdZdd� Z dd � Z d d� Zdd � Zdd� Z dd� Zdd� Zdd� ZdS )�MakeServiceTestsz' Tests for L{tap.makeService}. zcan't run without cryptographyzCannot run without PyASN1z can't run on non-posix computers)s iamusers thisispasswordc C sV | � � | _t| jd��"}|�d�| j�� W d � n1 s>0 Y t�� | _dS )z/ Create a file with two users. zwb+� :N) �mktemp�filename�open�write�join�usernamePasswordr �Options�options)�self�f� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/conch/test/test_tap.py�setUp( s 0zMakeServiceTests.setUpc C s@ t �� }t �|�}| �|t� | �|jjd� | �|jt � dS )z� L{tap.makeService} returns a L{StreamServerEndpointService} instance running on TCP port 22, and the linked protocol factory is an instance of L{OpenSSHFactory}. � N) r r �makeServiceZassertIsInstancer �assertEqualZendpointZ_port�factoryr )r �config�servicer r r � test_basic1 s zMakeServiceTests.test_basicc C sN d}| � t| jd d� | � t| jd d� | �|t| jd �d|f � dS )z� Make sure that if the C{--auth} command-line option is not passed, the default checkers are (for backwards compatibility): SSH and UNIX � ZcredInterfacesz)SSH should be one of the default checkersz*UNIX should be one of the default checkers�credCheckersz&There should be %d checkers by defaultN)ZassertInr r r r �len)r ZnumCheckersr r r �test_defaultAuths= s ���z"MakeServiceTests.test_defaultAuthsc C s0 | j �dd| j g� | �t| j d �d� dS )z� The C{--auth} command-line option will add a checker to the list of checkers, and it should be the only auth checker �--auth�file:r$ � N�r �parseOptionsr r r% �r r r r �test_authAddedT s zMakeServiceTests.test_authAddedc C s4 | j �dd| j ddg� | �t| j d �d� dS )z� Multiple C{--auth} command-line options will add all checkers specified to the list ofcheckers, and there should only be the specified auth checkers (no default checkers). r'