← Back
Editing: test_tap.cpython-38.pyc
U W[W � @ s� d Z zddlZW n ek r( dZY nX zddlZW n ek rN dZY nX zddlmZ W n ek rx dZY nX er�er�er�ddlmZ ddlmZ ddl m Z ddlmZ ddl mZ dd l mZmZ dd lmZ G dd� de�ZdS ) z! Tests for L{twisted.conch.tap}. � N)�unix)�tap)�OpenSSHFactory)�StreamServerEndpointService)�error)�ISSHPrivateKey)�IUsernamePassword�UsernamePassword)�TestCasec @ 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 sB | � � | _t| jd��}|�d�| j�� W 5 Q R X t�� | _dS )z/ Create a file with two users. zwb+� :N) Zmktemp�filename�open�write�join�usernamePasswordr �Options�options)�self�f� r �=/usr/lib/python3/dist-packages/twisted/conch/test/test_tap.py�setUp4 s zMakeServiceTests.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_basic>