ϪfFdZddlmZmZddlmZddlmZddlm Z ddl m Z GddeZ Gd d eZ eje j!eje j!y ) z/ Tests for implementations of L{IReactorTime}. )IReactorThreads IReactorTime)ReactorBuilder)msg)platform)SkipTestc"eZdZdZefZdZdZy)TimeTestsBuilderzA Builder for defining tests relating to L{IReactorTime}. c||j}|jd|j|jy)z? The reactor can be stopped by a delayed call. rN) buildReactor callLaterstoprun)selfreactors A/usr/lib/python3/dist-packages/twisted/internet/test/test_time.pytest_delayedCallStopsReactorz-TimeTestsBuilder.test_delayedCallStopsReactors/##%!W\\* ch|jtjrdn tdj ddzdzd}fdfdj |j |j|j|jy ) 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)formatevent)rcallFromThread)rrs r eventSourcez=TimeTestsBuilder.test_distantDelayedCall..eventSource&s KSX&&u-rz=Do not know how to synthesize non-time event to stop the testcyNr rrz:TimeTestsBuilder.test_distantDelayedCall..2src<tdjy)NzStopping the reactor)rr)rsrrz6TimeTestsBuilder.test_distantDelayedCall..stop4s & ' LLNrcSrr )rrrsrr!z:TimeTestsBuilder.test_distantDelayedCall..<s[$%?rN) r r providedByrr r assertTrueactiveassertIngetDelayedCalls)r delayedCallrrrs @@@rtest_distantDelayedCallz(TimeTestsBuilder.test_distantDelayedCalls ##%  % %g . .O  ''3 LA   G?@    **,- k7#:#:#<=rN)__name__ __module__ __qualname____doc__rrequiredInterfacesrr*r rrr r s'*>rr cHeZdZdZefZejrdndgZdZ y)GlibTimeTestsBuilderza Builder for defining tests relating to L{IReactorTime} for reactors based off glib. z,twisted.internet.gireactor.PortableGIReactorz$twisted.internet.gireactor.GIReactorcddlm}|jgfd}fdj|jd||j d|j dgy) z A L{reactor.callLater} call scheduled from a C{gobject.timeout_add} call is run on time. r)GObjectc*jdy)Nr)r )callbackrsr gschedulez8GlibTimeTestsBuilder.test_timeout_add..gschedulefs   a *rcHjdjy)NT)appendr)rresultsrr5z7GlibTimeTestsBuilder.test_timeout_add..callbackjs MM$  LLNr TN) gi.repositoryr3r callWhenRunning timeout_add runReactor assertEqual)rr3r6r5rr9s @@@rtest_timeout_addz%GlibTimeTestsBuilder.test_timeout_addYs_ *##%    3 3RC # $(rN) r+r,r-r.rr/r isWindows _reactorsrAr rrr1r1Ks5 ' 8    7 3I )rr1N)r.twisted.internet.interfacesrr#twisted.internet.test.reactormixinsrtwisted.python.logrtwisted.python.runtimertwisted.trial.unittestrr r1globalsupdatemakeTestCaseClassesr rrrLslF>"++9>~9>x%)>%)P !5578 %99;