Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/twisted/internet/test/__pycache__/ |
Upload File : |
o �bXH � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z mZmZm Z ddlmZmZmZmZmZmZ ddlmZmZ dd lmZ dd lmZmZ ddlmZ G dd � d e�ZG dd� de�Z G dd� de�Z!G dd� de�Z"G dd� de�Z#dS )z) Tests for L{twisted.internet.protocol}. � )�BytesIO)�implementer)�verifyObject)�CancelledError)� IConsumer�ILoggingContext� IProtocol�IProtocolFactory)� ClientCreator�ConsumerToProtocolAdapter�Factory�FileWrapper�Protocol�ProtocolToConsumerAdapter)�LogLevel�globalLogPublisher)�Failure)�MemoryReactorClock�StringTransport)�TestCasec @ s� e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zdd� Zd d!� Zd"S )#�ClientCreatorTestsz? Tests for L{twisted.internet.protocol.ClientCreator}. c C sD G dd� dt �}t� }t||�}|||�}|�d�}| �||� dS )a Helper for implementing a test to verify that one of the I{connect} methods of L{ClientCreator} passes the right arguments to the right reactor method. @param check: A function which will be invoked with a reactor and a L{ClientCreator} instance and which should call one of the L{ClientCreator}'s I{connect} methods and assert that all of its arguments except for the factory are passed on as expected to the reactor. The factory should be returned. c @ � e Zd ZdS )z:ClientCreatorTests._basicConnectTest.<locals>.SomeProtocolN��__name__� __module__�__qualname__� r r �E/usr/lib/python3/dist-packages/twisted/internet/test/test_protocol.py�SomeProtocol5 � r N)r r r � buildProtocol�assertIsInstance)�self�checkr �reactor�cc�factory�protocolr r r �_basicConnectTest( s z$ClientCreatorTests._basicConnectTestc � � fdd�}� � |� dS )z� L{ClientCreator.connectTCP} calls C{reactor.connectTCP} with the host and port information passed to it, and with a factory which will construct the protocol passed to L{ClientCreator.__init__}. c sX |� dddd� | j�� \}}}}}� �|d� � �|d� � �|d� � �|d� |S )N�example.com�� �� )z1.2.3.4i�&