관리-도구
편집 파일: test_utils.cpython-311.pyc
� �܋f�N � �` � d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl mZmZ ddl mZ ddlmZmZmZmZmZmZmZmZmZ ddlmZmZ ddlmZ ddlmZm Z dd l!m"Z" ddl#Z#dd l$m%Z%m&Z& ddl'm(Z(m)Z) dd l m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2m3Z3 ddl4m5Z5 ddl6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z> ddl?m@Z@ erddlAmBZB ndZBejC dk o ejD dk ZEejF fdeGdejH dej fd�ZIdeGdeJdejH dej fd�ZKdeJfd�ZL G d� d e� � ZM G d!� d"eM� � ZN G d#� d$eM� � ZO G d%� d&� � ZP G d'� d(e� � ZQd)ed*ed+edefd,�ZReg ejS f ZTejU ejV d-fd.eTd/eWdeejS fd0�� � ZXejV fd.eTdejS fd1�ZYdJd2ejS d/eWddfd3�ZZdej[ fd4�Z\dKd5eeB dej] fd6�Z^ dKe0 e2dd� � d-de0e0e0e0dd7d8d9�d:eGd;eGd<ed=ed>e2d?eWd@edAedBedCedDed5eeB dEeJd2ede:fdF�Z_e0e0fdGedHedefdI�Z`dS )LzUtilities shared by tests.� N)�ABC�abstractmethod)� TracebackType) � TYPE_CHECKING�Any�Callable�Iterator�List�Optional�Type�Union�cast)�IsolatedAsyncioTestCase�mock)�Signal)�CIMultiDict�CIMultiDictProxy)�URL)�_RequestContextManager�_WSRequestContextManager� )� ClientSession�hdrs)�AbstractCookieJar)�ClientResponse)�ClientWebSocketResponse)�sentinel)�HttpVersion�RawRequestMessage)�StrOrURL)�Application� AppRunner� BaseRunner�Request�Server�ServerRunner�SockSite�UrlMappingMatchInfo)�_RequestHandler)� SSLContext�posix�cygwin�host�family�returnc �$ � t | d|� � S )Nr )�get_port_socket)r- r. s �e/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/aiohttp/test_utils.py�get_unused_port_socketr3 = s � � �4��F�+�+�+� �portc �� � t j |t j � � }t r+|� t j t j d� � |� | |f� � |S )Nr )�socket�SOCK_STREAM� REUSE_ADDRESS� setsockopt� SOL_SOCKET�SO_REUSEADDR�bind)r- r5 r. �ss r2 r1 r1 C sZ � � � �f�f�0�1�1�A�� @� ���V�&��(;�Q�?�?�?��F�F�D�$�<�����Hr4 c � � t j t j t j � � 5 } | � d� � t t | � � � d � � cddd� � S # 1 swxY w Y dS )z1Return a port that is unused on the current host.)� 127.0.0.1r r N)r7 �AF_INETr8 r= r �int�getsockname)r>