o
    b                     @   sL   d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 G dd de	Z
dS )	z,
Tests for L{twisted.application.strports}.
    )internetstrports)TCP4ServerEndpoint)Factory)TestCasec                   @   s    e Zd ZdZdd Zdd ZdS )ServiceTestsz(
    Tests for L{strports.service}.
    c                 C   s   t  }t }d}tjdt| ||d}| |tj | |j	 | |j
t | |j
j| | |j| | |j
j| dS )z
        L{strports.service} returns a L{StreamServerEndpointService}
        constructed with an endpoint produced from
        L{endpoint.serverFromString}, using the same syntax.
        i9  ztcp:reactorN)objectr   r   servicestrassertIsInstancer   StreamServerEndpointService
assertTrue_raiseSynchronouslyendpointr   assertEqual_portassertIsfactory_reactor)selfr	   aFactory	aGoodPortsvc r   </usr/lib/python3/dist-packages/twisted/test/test_strports.pytest_service   s   zServiceTests.test_servicec                 C   s,   ddl m} tdd}| |jj| dS )zp
        L{strports.service} will use the default reactor when none is provided
        as an argument.
        r   r   ztcp:80N)twisted.internetr	   r   r   r   r   r   )r   globalReactoraServicer   r   r   test_serviceDefaultReactor)   s   z'ServiceTests.test_serviceDefaultReactorN)__name__
__module____qualname____doc__r   r!   r   r   r   r   r      s    r   N)r%   twisted.applicationr   r   twisted.internet.endpointsr   twisted.internet.protocolr   twisted.trial.unittestr   r   r   r   r   r   <module>   s   