%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/test/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/test/__pycache__/test_ident.cpython-312.pyc |
� Ϫ�f< � � � d Z ddlZddlZddlmZ ddlmZmZ ddlm Z ddl mZ ddlm Z ddlmZ G d � d ej � Z G d� dej$ � Z G d � dej$ � Z G d� de� Z G d� dej � Z ej0 dd� dd dk( rdZdZndZdZ G d� dej � Zy)z0 Test cases for twisted.protocols.ident module. � N)�StringIO)�defer�error)�StringTransport)�ident)�failure)�unittestc �4 � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z y) �ClassParserTestsz* Test parsing of ident responses. c �6 � t j � | _ y)z7 Create an ident client used in tests. N)r �IdentClient�client��selfs �9/usr/lib/python3/dist-packages/twisted/test/test_ident.py�setUpzClassParserTests.setUp s � � �'�'�)��� c �� � t j � }| j j j |ddf� | j j d� | j |t j � 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 �ds r �test_indentErrorz!ClassParserTests.test_indentError sZ � � �N�N��������"�"�A�s�C�=�1���� � �!C�D��!�!�!�U�%5�%5�6�6r c �� � t j � }| j j j |ddf� | j j d� | j |t j � 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 s r �test_noUSerErrorz!ClassParserTests.test_noUSerError( sX � � �N�N��������"�"�A�s�C�=�1���� � �!=�>��!�!�!�U�\�\�2�2r c �� � t j � }| j j j |ddf� | j j d� | j |t j � 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 s r �test_invalidPortErrorz&ClassParserTests.test_invalidPortError1 sZ � � �N�N��������"�"�A�s�C�=�1���� � �!C�D��!�!�!�U�%6�%6�7�7r c �� � t j � }| j j j |ddf� | j j d� | j |t j � S )zV 'HIDDEN-USER' error should map to the L{ident.HiddenUser} exception. r% i z567, 789 : ERROR : HIDDEN-USER) r r r r r r r r � HiddenUserr s r �test_hiddenUserErrorz%ClassParserTests.test_hiddenUserError: sZ � � �N�N��������"�"�A�s�C�=�1���� � �!A�B��!�!�!�U�%5�%5�6�6r c �: � t j � }| j j j |ddf� | j j t j t j � � � | j |t j � S )zy A pending query which failed because of a ConnectionLost should receive an L{ident.IdentError}. i� i� ) r r r r r �connectionLostr �Failurer �ConnectionLostr r r r s r �test_lostConnectionz$ClassParserTests.test_lostConnectionC sk � � �N�N��������"�"�A�s�C�=�1����"�"�7�?�?�5�3G�3G�3I�#J�K��!�!�!�U�%5�%5�6�6r N) �__name__� __module__�__qualname__�__doc__r r r# r'