Current File : //proc/self/root/lib/python3/dist-packages/twisted/test/__pycache__/test_strports.cpython-312.pyc |
�
Ϫ�f� � �R � d Z ddlmZmZ ddlmZ ddlmZ ddlm Z G d� de � Z
y) z,
Tests for L{twisted.application.strports}.
� )�internet�strports)�TCP4ServerEndpoint)�Factory)�TestCasec � � e Zd ZdZd� Zd� Zy)�ServiceTestsz(
Tests for L{strports.service}.
c � � t � }t � }d}t j dt |� 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 ztcp:��reactorN)�objectr r �service�str�assertIsInstancer �StreamServerEndpointService�
assertTrue�_raiseSynchronously�endpointr �assertEqual�_port�assertIs�factory�_reactor)�selfr �aFactory� aGoodPort�svcs �</usr/lib/python3/dist-packages/twisted/test/test_strports.py�test_servicezServiceTests.test_service s� � � �(���9��� ����v��I��6��'�R�����c�8�#G�#G�H�
����/�/�0����c�l�l�,>�?�������+�+�Y�7��
�
�c�k�k�8�,��
�
�c�l�l�+�+�W�5� c � � ddl m} t j dd� }| j |j
j |� y)zp
L{strports.service} will use the default reactor when none is provided
as an argument.
r r ztcp:80N)�twisted.internetr r r r r r )r �
globalReactor�aServices r �test_serviceDefaultReactorz'ServiceTests.test_serviceDefaultReactor) s3 � �
>��#�#�H�d�3���
�
�h�'�'�0�0�-�@r N)�__name__�
__module__�__qualname__�__doc__r r% � r r r r s � ��6�*Ar r N)r) �twisted.applicationr r �twisted.internet.endpointsr �twisted.internet.protocolr �twisted.trial.unittestr r r* r r �<module>r/ s&