%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/web/test/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/web/test/__pycache__/test_agent.cpython-312.pyc |
� Ϫ�f�� � �� � d Z ddlmZ ddlZddlmZ ddlmZ ddlm Z m Z mZmZm Z mZ ddlmZmZ ddlmZ dd lmZ dd lmZ ddlmZmZ ddlmZmZ dd lmZm Z m!Z! ddl"m#Z#m$Z$ ddl%m&Z&m'Z'm(Z( ddl)m*Z* ddl+m,Z,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3m4Z4m5Z5m6Z6 ddl7m8Z8 ddl9m:Z: ddl;m<Z< ddl=m>Z> ddl?m@Z@mAZA ddlBmCZC ddlDmEZEmFZF ddlGmHZHmIZImJZJ ddlKmLZLmMZMmNZNmOZOmPZPmQZQmRZR ddlSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[ ddl\m]Z] dd l^m_Z_ dd!l`maZambZbmcZcmdZdmeZemfZf dd"lgmhZhmiZi e reFZjekZlnekZjeFZl dd#lmmZn enZmd$Zodd%lpmqZqmrZr dd&lsmtZt dd'lumvZv dd(lwmxZxmyZy eer� G d)� d*� � Zz G d,� d-e-� Z| G d.� d/� Z} G d0� d1eF� Z~d2Zd3Z�d4Z�d5Z�d6Z�d7Z� G d8� d9� Z� G d:� d;� Z� G d<� d=� Z� G d>� d?e,� Z� G d@� dAeFe�� Z� G dB� dC� Z� G dD� dE� Z� eec� G dF� dG� � Z� G dH� dIeFe�e�e�� Z� G dJ� dKe�eheE� Z� G dL� dMe�eieE� Z� eeo dN� G dO� dPeFe�e�� � Z� G dQ� dReF� Z� G dS� dTeFe�� Z� G dU� dV� Z� G dW� dXeFe�� Z� G dY� dZeFe�e�e�� Z� G d[� d\ e:ef� � Z� G d]� d^e�� Z� G d_� d`eFe�e�� Z� G da� dbe-� Z� G dc� ddeFe�� Z� G de� dfeFe�e�� Z�g dg�Z� G dh� diej� Z� G dj� dke�e�e�el� Z� G dl� dme�e�e�el� Z� G dn� doe6� Z� G dp� dq� Z� G dr� dse�� Z� G dt� dueF� Z� eeo dN� G dv� dweF� � Z� G dx� dyeheE� Z� G dz� d{eheE� Z� G d|� d}eieE� Z� G d~� deieE� Z�y# e{$ r dZmd+ZoY ���w xY w)�zD Tests for L{twisted.web.client.Agent} and related new client APIs. � )�annotationsN)� CookieJar)�BytesIO)� TYPE_CHECKING�Dict�List�Optional�Sequence�Tuple)�SkipTest�skipIf��implementer)�verifyObject)�Version)�defer�task)�IPv4Address�IPv6Address)�CancelledError�Deferred�succeed)�HostnameEndpoint�TCP4ClientEndpoint)�ConnectionDone�ConnectionLost�ConnectionRefusedError)�IOpenSSLClientConnectionCreator)�Factory�Protocol)�Clock)�deterministicResolvingReactor)�AccumulatingProtocol�EventLoggingObserver�MemoryReactorClock�StringTransport)�globalLogPublisher)�proxyForInterface)�getDeprecationWarningString)�Failure)� FakeTransport�IOPump)�!certificatesForAuthorityAndServer)�SynchronousTestCase�TestCase)�client�error�http_headers)�HTTP11ClientProtocol�PotentialDataLoss�RequestNotSent�RequestTransmissionFailed�Response�ResponseFailed�ResponseNeverReceived)�URI�BrowserLikePolicyForHTTPS�FileBodyProducer�HostnameCachingHTTPSPolicy�HTTPConnectionPool�Request�ResponseDone�_HTTP11ClientFactory)�SchemeNotSupported)�Headers)�UNKNOWN_LENGTH�IAgent�IAgentEndpointFactory� IBodyProducer�IPolicyForHTTPS� IResponse)�MethodInjectionTestsMixin�URIInjectionTestsMixin)�sslT)�ClientTLSOptions�IOpenSSLTrustRoot)�optionsForClientTLS)�tls)�TLSMemoryBIOFactory�TLSMemoryBIOProtocolc � � e Zd ZdZdZd� Zy)�CustomOpenSSLTrustRootFNc � � d| _ || _ y �NT)�called�context)�selfrX s �=/usr/lib/python3/dist-packages/twisted/web/test/test_agent.py�_addCACertsToContextz+CustomOpenSSLTrustRoot._addCACertsToContextm s � ��D�K�"�D�L� )�__name__� __module__�__qualname__rW rX r[ � r\ rZ rT rT h s � ����� #r\ rT Fc � � e Zd ZdZdd�Zd� Zy)�StubHTTPProtocolaR A protocol like L{HTTP11ClientProtocol} but which does not actually know HTTP/1.1 and only collects requests in a list. @ivar requests: A C{list} of two-tuples. Each time a request is made, a tuple consisting of the request and the L{Deferred} returned from the request method is appended to this list. c � � g | _ d| _ y )N� QUIESCENT)�requests�state�rY s rZ �__init__zStubHTTPProtocol.__init__| s � �CE�� � �� r\ c �T � t � }| j j ||f� |S )z� Capture the given request for later inspection. @return: A L{Deferred} which this code will never fire. )r re �append)rY �request�results rZ rk zStubHTTPProtocol.request� s'