← Back
Editing: test_ident.cpython-38.pyc
U W[g � @ s$ d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddlmZ dd l mZ zddlZW n ek r� ddlZY nX G d d� dej�ZG dd � d ej�ZG dd� dej�ZG dd� de�ZG dd� dej�Ze�dd�dd� dk�rdZdZndZdZG dd� dej�ZdS )z0 Test cases for twisted.protocols.ident module. � N)�ident)�failure)�error)�defer)�NativeStringIO)�unittest)�StringTransportc @ s@ e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dS )�ClassParserTestsz* Test parsing of ident responses. c C s t �� | _dS )z7 Create an ident client used in tests. N)r ZIdentClient�client��self� r �9/usr/lib/python3/dist-packages/twisted/test/test_ident.py�setUp! s zClassParserTests.setUpc C s6 t �� }| jj�|ddf� | j�d� | �|tj�S )zX 'UNKNOWN-ERROR' error should map to the L{ident.IdentError} exception. �{ �� z 123, 456 : ERROR : UNKNOWN-ERROR) r �Deferredr �queries�append�lineReceived� assertFailurer � IdentError�r �dr r r �test_indentError( s z!ClassParserTests.test_indentErrorc C s6 t �� }| jj�|ddf� | j�d� | �|tj�S )zN 'NO-USER' error should map to the L{ident.NoUser} exception. �� r z234, 456 : ERROR : NO-USER) r r r r r r r r �NoUserr r r r �test_noUSerError2 s z!ClassParserTests.test_noUSerErrorc C s6 t �� }| jj�|ddf� | j�d� | �|tj�S )zX 'INVALID-PORT' error should map to the L{ident.InvalidPort} exception. iY �7 z 345, 567 : ERROR : INVALID-PORT) r r r r r r r r �InvalidPortr r r r �test_invalidPortError<