
    Vh                     R    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e	      Z
y)	z,
Tests for L{twisted.application.strports}.
    )internetstrports)TCP4ServerEndpoint)Factory)TestCasec                       e Zd ZdZd Zd Zy)ServiceTestsz(
    Tests for L{strports.service}.
    c                    t               }t               }d}t        j                  dt	        |      z   ||      }| j                  |t        j                         | j                  |j                         | j                  |j                  t               | j                  |j                  j                  |       | j                  |j                  |       | j                  |j                  j                   |       y)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svcs        J/home/dcms/DCMS/lib/python3.12/site-packages/twisted/test/test_strports.pytest_servicezServiceTests.test_service   s     (9	vI6'Rc8#G#GH 	//0cll,>?++Y7ckk8,cll++W5    c                     ddl m} t        j                  dd      }| j	                  |j
                  j                  |       y)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aServices      r   test_serviceDefaultReactorz'ServiceTests.test_serviceDefaultReactor)   s3    
 	>##Hd3h''00-@r    N)__name__
__module____qualname____doc__r   r%    r    r   r	   r	      s    6*Ar    r	   N)r)   twisted.applicationr   r   twisted.internet.endpointsr   twisted.internet.protocolr   twisted.trial.unittestr   r	   r*   r    r   <module>r/      s&   
 3 9 - +"A8 "Ar    