Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/test/__pycache__/test_unix.cpython-39.pyc
Ðазад
a k�h5 � @ s d Z ddlZddlZddlZddlmZ ddlmZmZm Z m Z mZmZm Z ddlmZ ddlmZ ddlmZ ddlmZmZ dd lmZ G d d� dej�Zee �ed� d�G d d� dej��ZG dd� dej�ZG dd� dej�Z ee �!ed� d�G dd� dej��Z"dS )zK Tests for implementations of L{IReactorUNIX} and L{IReactorUNIXDatagram}. � N)�skipIf)�address�defer�error� interfaces�protocol�reactor�utils)�lockfile)� networkString)�FilePath)�MyClientFactory�MyServerFactory)�unittestc @ s e Zd Zdd� Zdd� ZdS )�FailedConnectionClientFactoryc C s || _ d S �N)�onFail)�selfr � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/test/test_unix.py�__init__ s z&FailedConnectionClientFactory.__init__c C s | j �|� d S r )r Zerrback)r Z connector�reasonr r r �clientConnectionFailed s z4FailedConnectionClientFactory.clientConnectionFailedN)�__name__� __module__�__qualname__r r r r r r r s r �1This reactor does not support UNIX domain socketsc @ sh e Zd ZdZe�ed�sdZdd� Zdd� Z dd � Z d d� Zdd � Zdd� Z dd� Zdd� Zdd� ZdS )�UnixSocketTestsz Test unix sockets. Nr c s� �� � }�� � � t� �t�� }�_t�|��}��|j� t � t j t j�}��|j� |� � � |�|� � ��fdd�}|�|� |S )z� The address passed to the server factory's C{buildProtocol} method and the address returned by the connected protocol's transport's C{getPeer} method match the address the client socket is bound to. c s0 t �� �}���j|g� ��| j�� |� d S r )r �UNIXAddress�assertEqual� peerAddresses� transportZgetPeer)�proto�expected�Zpeernamer � serverFactoryr r � cbConnMade; s z1UnixSocketTests.test_peerBind.<locals>.cbConnMade)�mktempr r �Deferred�protocolConnectionMader � listenUNIX� addCleanup� stopListening�socket�AF_UNIX�SOCK_STREAM�close�bind�connect�addCallback)r �filenameZconnMade�unixPortZ unixSocketr&