%PDF- %PDF-
Mini Shell

Mini Shell

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

�

Ϫ�fF���dZddlmZmZddlmZddlmZddlm	Z	ddl
mZGd�de�ZGd	�d
e�Z
e�jej!��e�je
j!��y)z/
Tests for implementations of L{IReactorTime}.
�)�IReactorThreads�IReactorTime)�ReactorBuilder)�msg)�platform)�SkipTestc�"�eZdZdZefZd�Zd�Zy)�TimeTestsBuilderzA
    Builder for defining tests relating to L{IReactorTime}.
    c�|�|j�}|jd|j�|j�y)z?
        The reactor can be stopped by a delayed call.
        rN)�buildReactor�	callLater�stop�run)�self�reactors  �A/usr/lib/python3/dist-packages/twisted/internet/test/test_time.py�test_delayedCallStopsReactorz-TimeTestsBuilder.test_delayedCallStopsReactors/���#�#�%�����!�W�\�\�*����
�c�h����|j��tj��rd��ntd���j	ddzdzd��}�fd�������fd���j�|j
|j��|j|�j��y	)
z
        Scheduling a delayed call at a point in the extreme future does not
        prevent normal reactor operation.
        c�@�td|��|j|�y)Nz.Thread-based event-source scheduling %(event)r)�format�event)r�callFromThread)rrs  r�eventSourcez=TimeTestsBuilder.test_distantDelayedCall.<locals>.eventSource&s ���K�SX���&�&�u�-rz=Do not know how to synthesize non-time event to stop the test���c��y�N�r rr�<lambda>z:TimeTestsBuilder.test_distantDelayedCall.<locals>.<lambda>2s�rc�<��td��j�y)NzStopping the reactor)rr)rs�rrz6TimeTestsBuilder.test_distantDelayedCall.<locals>.stop4s����&�'��L�L�Nrc�������Srr )rrrs���rr!z:TimeTestsBuilder.test_distantDelayedCall.<locals>.<lambda><s���[��$�%?�rN)
rr�
providedByrr
r�
assertTrue�active�assertIn�getDelayedCalls)r�delayedCallrrrs  @@@r�test_distantDelayedCallz(TimeTestsBuilder.test_distantDelayedCalls����
�#�#�%���%�%�g�.�
.��O��
�
�'�'��3���
�L�A��	�	�G�?�@�	���
�	
����*�*�,�-��
�
�k�7�#:�#:�#<�=rN)�__name__�
__module__�__qualname__�__doc__r�requiredInterfacesrr*r rrr
r
s���'����*>rr
c�H�eZdZdZefZej�rdndgZd�Z	y)�GlibTimeTestsBuilderza
    Builder for defining tests relating to L{IReactorTime} for reactors based
    off glib.
    z,twisted.internet.gireactor.PortableGIReactorz$twisted.internet.gireactor.GIReactorc������ddlm}|j��g���fd�}��fd���j|jd|�|j�d�|j
�dg�y)	z�
        A
        L{reactor.callLater<twisted.internet.interfaces.IReactorTime.callLater>}
        call scheduled from a C{gobject.timeout_add}
        call is run on time.
        r)�GObjectc�*���jd��y)Nr)r
)�callbackrs��r�	gschedulez8GlibTimeTestsBuilder.test_timeout_add.<locals>.gschedulefs������a��*�rc�H���jd��j�y)NT)�appendr)r�results��rr5z7GlibTimeTestsBuilder.test_timeout_add.<locals>.callbackjs����M�M�$���L�L�Nr�
�TN)�
gi.repositoryr3r�callWhenRunning�timeout_add�
runReactor�assertEqual)rr3r6r5rr9s   @@@r�test_timeout_addz%GlibTimeTestsBuilder.test_timeout_addYs_���	*��#�#�%����	�	�	���� 3� 3�R��C������#�����$��(rN)
r+r,r-r.rr/r�	isWindows�	_reactorsrAr rrr1r1Ks5���
'����8����	7�
3��I�)rr1N)r.�twisted.internet.interfacesrr�#twisted.internet.test.reactormixinsr�twisted.python.logr�twisted.python.runtimer�twisted.trial.unittestrr
r1�globals�update�makeTestCaseClassesr rr�<module>rLsl���F�>�"�+�+�9>�~�9>�x%)�>�%)�P�	���!�5�5�7�8��	���%�9�9�;�<r

Zerion Mini Shell 1.0