File: //usr/lib/python3/dist-packages/twisted/web/test/__pycache__/test_http.cpython-310.pyc
o
^h�b�R � @ s* d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl m
Z
mZ ddlm
Z
ddlmZ ddlmZmZmZ dd lmZmZmZ dd
lmZ ddlZddlmZ ddlmZmZ dd
lm Z ddl!m"Z" ddl#m$Z$ ddl%m&Z&m'Z' ddl(m)Z) ddl*m+Z+ ddl,m-Z-m.Z.m/Z/ ddl0m1Z1 ddl2mZ ddl3m4Z4 ddl5m6Z6m7Z7m8Z8 ddl9m:Z:m;Z;m<Z< ddl=m>Z>m?Z?m@Z@mAZA ddlBmCZC G dd� de)e6jD��ZEdd� ZFG d d!� d!e6jG�ZHeFeH�ZIG d"d#� d#ej4�ZJG d$d%� d%e6jG�ZKeFeK�ZLee8jM�G d&d'� d'eK��ZNeFeN�ZOG d(d)� d)eK�ZPeFeP�ZQG d*d+� d+e6jR�ZSd,d-� ZTG d.d/� d/�ZUG d0d1� d1ej4eU�ZVG d2d3� d3eV�ZWG d4d5� d5eV�ZXG d6d7� d7eV�ZYG d8d9� d9ej4eU�ZZG d:d;� d;ej4�Z[G d<d=� d=ej4�Z\G d>d?� d?ej4�Z]G d@dA� dAej4�Z^dBdC� Z_G dDdE� dEej4�Z`G dFdG� dGe4�ZaG dHdI� dIej4�ZbG dJdK� dKej4eU�ZcG dLdM� dMej4�ZdG dNdO� dOej4�ZeG dPdQ� dQe6jR�ZfG dRdS� dSej4�ZgG dTdU� dUej4eU�ZhG dVdW� dWej4�ZiG dXdY� dYej4eU�ZjdZd[� ZkG d\d]� d]ej4�ZlG d^d_� d_ej4�ZmG d`da� daejn�ZoG dbdc� dcejn�ZpG ddde� deejn�ZqdS )fz
Test HTTP support.
� N)�BytesIO)�cycle)�Sequence�Union)�skipIf��clear_cache)�parse_qs�urlparse�
urlunsplit)�directlyProvides�
providedBy�provider)�verifyObject)�address)�ConnectionDone�ConnectionLost)�Clock)�globalLogPublisher)�loopback)� iterbytes�
networkString)�proxyForInterface)�Failure)�EventLoggingObserver�NonStreamingProducer�StringTransport)�
DummyProducer)�unittest)�TestCase)�http�http_headers�iweb)�PotentialDataLoss� _DataLoss�_IdentityTransferDecoder)�DummyChannel�bytesLinearWhitespaceComponents�sanitizedBytes�textLinearWhitespaceComponents� )�assertIsFilesystemTemporaryc @ s e Zd ZdZdS )�._IDeprecatedHTTPChannelToRequestInterfaceProxyz�
Proxy L{_IDeprecatedHTTPChannelToRequestInterface}. Used to
assert that the interface matches what L{HTTPChannel} expects.
N)�__name__�
__module__�__qualname__�__doc__� r1 r1 �</usr/lib/python3/dist-packages/twisted/web/test/test_http.pyr, 4 s r, c s � fdd�}t |t� �� |S )a�
Return a callable that proxies instances of C{clsToWrap} via
L{_IDeprecatedHTTPChannelToRequestInterface}.
@param clsToWrap: The class whose instances will be proxied.
@type cls: L{_IDeprecatedHTTPChannelToRequestInterface}
implementer.
@return: A factory that returns
L{_IDeprecatedHTTPChannelToRequestInterface} proxies.
@rtype: L{callable} whose interface matches C{clsToWrap}'s constructor.
c s � | i |��}t |�S �N)r, )�args�kwargs�instance�� clsToWrapr1 r2 �_makeRequestProxyM s z3_makeRequestProxyFactory.<locals>._makeRequestProxy)r r
)r8 r9 r1 r7 r2 �_makeRequestProxyFactory? s r: c @ � e Zd ZdZdd� ZdS )�DummyPullProducerHandlerz�
An HTTP request handler that registers a dummy pull producer to serve the
body.
The owner must call C{finish} to complete the response.
c C s&