0x1949 Team - FAZEMRX - MANAGER
Edit File: test_amp.cpython-310.pyc
o �b�� � @ s@ d Z ddlZddlZddlmZmZ ddlmZ ddlm Z ddl mZmZ ddl mZmZmZmZmZmZ ddlmZ dd lmZ dd lmZ ddlmZ ddlmZ dd lmZ zddl m Z! W n e"ym dZ Y n w e!j#stdZ ne!Z e du r}dZ$ndZ$ej%�&e�s�dZ'ndZ'ej(j)Z*G dd� dej+�Z,G dd� dej-�Z.G dd� de/�Z0G dd� de/�Z1G dd� de/�Z2G dd� dej3�Z4G dd� dej5�Z6G dd � d e6�Z7G d!d"� d"ej5�Z8G d#d$� d$ej5�Z9G d%d&� d&ej5�Z:G d'd(� d(ej5�Z;G d)d*� d*ej5�Z<G d+d,� d,ej5�Z=G d-d.� d.ej5�Z>G d/d0� d0ej5�Z?G d1d2� d2ej@�ZAG d3d4� d4ejB�ZCd5ZDG d6d7� d7e/�ZEG d8d9� d9ej-�ZFG d:d;� d;eF�ZGG d<d=� d=eG�ZHG d>d?� d?eG�ZIG d@dA� dAeG�ZJe.e.fdBdC�ZKG dDdE� dEej+�ZLG dFdG� dGej-�ZMG dHdI� dIe�ZNG dJdK� dKe�ZOG dLdM� dM�ZPG dNdO� dO�ZQG dPdQ� dQe�ZRG dRdS� dSej5�ZSG dTdU� dUejT�ZUG dVdW� dWeU�ZVG dXdY� dYeV�ZWG dZd[� d[ej-�ZXG d\d]� d]e�ZYd^ZZd_Z[G d`da� dae�Z\G dbdc� dce�Z]G ddde� de�Z^G dfdg� dg�Z_G dhdi� die_�Z`G djdk� dke_�ZaG dldm� dme_�ZbG dndo� doeF�Zcee$dp�ee'dq�G drds� dse���ZdG dtdu� due�ZeG dvdw� dwe/�ZfG dxdy� dye/�ZgG dzd{� d{ej5�ZhG d|d}� d}eh�ZiG d~d� deh�ZjG d�d�� d�ej-�ZkG d�d�� d�ej-�ZlG d�d�� d�ej-�ZmG d�d�� d�e�Znd�d�� ZoG d�d�� d��Zpd�d�� Zqd�d�� Zre du�r�er� Zsee$dp�ee'dq�G d�d�� d�epe���ZtG d�d�� d�eG�Zuee$dp�ee'dq�G d�d�� d�epe���Zvee$dp�ee'dq�G d�d�� d�epe���ZwG d�d�� d�ej3�ZxG d�d�� d�ej5�ZyG d�d�� d�ej5�ZzG d�d�� d�ej-�Z{G d�d�� d�e|�Z}G d�d�� d�ey�Z~G d�d�� d�e�ZG d�d�� d��Z�G d�d�� d�ee��Z�G d�d�� d�ee��Z�G d�d�� d�ee��Z�G d�d�� d�ee��Z�G d�d�� d�ee��Z�G d�d�� d�e�Z�G d�d�� d�e�Z�G d�d�� d�ee��Z�G d�d�� d�e�Z�e ej��G d�d�� d���Z�eej�e�� eej�e�� G d�d�� d�e�Z�G d�d�� d�e�Z�G d�d�� d�e�Z�G d�dÄ d�e�Z�dS )�z% Tests for L{twisted.protocols.amp}. � N)�Dict�Type)�skipIf)�implementer)�verifyClass�verifyObject)�address�defer�error� interfaces�protocol�reactor)�amp)�filepath)�Failure)�iosim)�StringTransport)�TestCase��sslTFc @ sB e Zd ZdZdZdd� Zdd� Zdd� Zd d � Zde fdd �Z dS )� TestProtoz� A trivial protocol for use in testing where a L{Protocol} is expected. @ivar instanceId: the id of this instance @ivar onConnLost: deferred that will fired when the connection is lost @ivar dataToSend: data to send on the protocol r c C s: t |t�sJ t|���|| _|| _tj| _tjd t_d S )N� )� isinstance�bytes�repr� onConnLost� dataToSendr � instanceCount� instanceId)�selfr r � r �7/usr/lib/python3/dist-packages/twisted/test/test_amp.py�__init__= s zTestProto.__init__c C s g | _ | j�| j� d S �N)�data� transport�writer �r r r r! �connectionMadeD s zTestProto.connectionMadec C � | j �|� d S r# )r$ �append)r r r r r! �dataReceivedH � zTestProto.dataReceivedc C s | j �| j� d S r# )r �callbackr$ �r �reasonr r r! �connectionLostK � zTestProto.connectionLost�returnc C s d| j f S )z� Custom repr for testing to avoid coupling amp tests with repr from L{Protocol} Returns a string which contains a unique identifier that can be looked up using the instanceId property:: <TestProto #3> z<TestProto #%d>)r r'