HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/internet/test/__pycache__/test_time.cpython-38.pyc
U


W[��@s�dZeZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
Gdd�de
�ZGd	d
�d
e
�Ze��e���e��e���dS)z/
Tests for implementations of L{IReactorTime}.
�)�msg)�platform)�SkipTest)�ReactorBuilder)�IReactorTime�IReactorThreadsc@s&eZdZdZefZdd�Zdd�ZdS)�TimeTestsBuilderzA
    Builder for defining tests relating to L{IReactorTime}.
    cCs"|��}|�d|j�|��dS)z?
        The reactor can be stopped by a delayed call.
        rN)�buildReactor�	callLater�stop�run)�self�reactor�r�A/usr/lib/python3/dist-packages/twisted/internet/test/test_time.py�test_delayedCallStopsReactorsz-TimeTestsBuilder.test_delayedCallStopsReactorcs�|���t���rdd��ntd����ddddd��}�fd	d
�������fdd�����|�|���|�|��	��dS)
z
        Scheduling a delayed call at a point in the extreme future does not
        prevent normal reactor operation.
        cSstd|d�|�|�dS)Nz.Thread-based event-source scheduling %(event)r)�format�event)rZcallFromThread)rrrrr�eventSource(s�z=TimeTestsBuilder.test_distantDelayedCall.<locals>.eventSourcez=Do not know how to synthesize non-time event to stop the test���cSsdS�Nrrrrr�<lambda>1�z:TimeTestsBuilder.test_distantDelayedCall.<locals>.<lambda>cstd����dS)NzStopping the reactor)rrr)rrrr3sz6TimeTestsBuilder.test_distantDelayedCall.<locals>.stopcs
����Srrr�rrrrrr;rN)
r	rZ
providedByrr
rZ
assertTrueZactiveZassertInZgetDelayedCalls)r
ZdelayedCallrrr�test_distantDelayedCall!s

z(TimeTestsBuilder.test_distantDelayedCallN)�__name__�
__module__�__qualname__�__doc__r�requiredInterfacesrrrrrrrs	rc@s6eZdZdZefZe��r"dgZnddgZdd�Z	dS)�GlibTimeTestsBuilderza
    Builder for defining tests relating to L{IReactorTime} for reactors based
    off glib.
    z/twisted.internet.gtk2reactor.PortableGtkReactorz*twisted.internet.glib2reactor.Glib2Reactorz(twisted.internet.gtk2reactor.Gtk2Reactorcs^ddl}|���g���fdd�}��fdd����|jd|�|��d�|��d	g�dS)
z�
        A
        L{reactor.callLater<twisted.internet.interfaces.IReactorTime.callLater>}
        call scheduled from a C{gobject.timeout_add}
        call is run on time.
        rNcs��d��dS)Nr)r
r)�callbackrrr�	gschedulecsz8GlibTimeTestsBuilder.test_timeout_add.<locals>.gschedulecs��d����dS)NT)�appendrr)r�resultrrr#fs
z7GlibTimeTestsBuilder.test_timeout_add.<locals>.callback�
�T)�gobjectr	ZcallWhenRunningZtimeout_addZ
runReactorZassertEqual)r
r)r$r)r#rr&r�test_timeout_addXsz%GlibTimeTestsBuilder.test_timeout_addN)
rrrr rr!rZ	isWindowsZ	_reactorsr*rrrrr"Ks�r"N)r �typeZ
__metaclass__Ztwisted.python.logrZtwisted.python.runtimerZtwisted.trial.unittestrZ#twisted.internet.test.reactormixinsrZtwisted.internet.interfacesrrrr"�globals�updateZmakeTestCaseClassesrrrr�<module>s9$