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 �b�$ � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m Z mZ ddlm Z mZ ddlmZ dd lmZ G d d� de �ZG dd � d e �ZG dd� de �ZG dd� de �Ze� �e�� � e� �e�� � e� �e�� � e� �e�� � dS )aD Tests for implementations of L{IReactorSocket}. Generally only tests for failure cases are found here. Success cases for this interface are tested elsewhere. For example, the success case for I{AF_INET} is in L{twisted.internet.test.test_tcp}, since that case should behave exactly the same as L{IReactorTCP.listenTCP}. � N)�verify)�UnsupportedAddressFamily)�IReactorSocket)�DatagramProtocol� ServerFactory)�ReactorBuilder�needsRunningReactor)�err)�platformc @ � e Zd ZdZegZdd� ZdS )�&IReactorSocketVerificationTestsBuilderaO Builder for testing L{IReactorSocket} implementations for required methods and method signatures. L{ReactorBuilder} already runs L{IReactorSocket.providedBy} to ensure that these tests will only be run on reactor classes that claim to implement L{IReactorSocket}. These tests ensure that reactors which claim to provide the L{IReactorSocket} interface actually have all the required methods and that those methods have the expected number of arguments. These tests will be skipped for reactors which do not claim to provide L{IReactorSocket}. c C s | � � }| �t�t|�� dS )zf The reactor instance returned by C{buildReactor} provides L{IReactorSocket}. N)�buildReactor� assertTruer �verifyObjectr )�self�reactor� r �C/usr/lib/python3/dist-packages/twisted/internet/test/test_socket.py� test_provider- s z4IReactorSocketVerificationTestsBuilder.test_providerN)�__name__� __module__�__qualname__�__doc__r �requiredInterfacesr r r r r r s r c @ �. e Zd ZdZegZdd� Zdd� Zdd� ZdS ) �!AdoptStreamPortErrorsTestsBuilderas Builder for testing L{IReactorSocket.adoptStreamPort} implementations. Generally only tests for failure cases are found here. Success cases for this interface are tested elsewhere. For example, the success case for I{AF_INET} is in L{twisted.internet.test.test_tcp}, since that case should behave exactly the same as L{IReactorTCP.listenTCP}. c C �r | � � }t�� }|�� }|�� | �tj|j|tjt� �}t � � r-| �|jd t j� dS | �|jd t j� dS )z� An implementation of L{IReactorSocket.adoptStreamPort} raises L{socket.error} if passed an integer which is not associated with a socket. r N)r �socket�fileno�close�assertRaises�error�adoptStreamPort�AF_INETr r � isWindows�assertEqual�args�errno�WSAENOTSOCK�EBADF�r r �prober �excr r r �test_invalidDescriptorB � �z8AdoptStreamPortErrorsTestsBuilder.test_invalidDescriptorc C sR | � � }t�� }|�d� |�d� | �|j� d}| �t|j|� � |t � � dS )z� An implementation of L{IReactorSocket.adoptStreamPort} raises L{UnsupportedAddressFamily} if passed an address family it does not support. �z 127.0.0.1r � � N)r r �bind�listen� addCleanupr r r r"