403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/twisted/internet/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyc
ó
6›öMc@sÖdZddlmZyddlZWnek
r?dZnXddlmZddlm	Z	ddl
mZddlm
Z
ddlmZd	efd
„ƒYZdefd„ƒYZeƒjejƒƒdS(
s6
Tests for implementations of L{IReactorWin32Events}.
iÿÿÿÿ(t	get_identN(tverifyObject(tisInIOThread(tIReactorWin32Events(tDeferred(tReactorBuildertListenercBsXeZdZeZdZZZd„Z	d„Z
d„Zd„Zd„Z
d„ZRS(sÔ
    L{Listener} is an object that can be added to a L{IReactorWin32Events}
    reactor to receive callback notification when a Windows event is set.  It
    records what thread its callback is invoked in and fires a Deferred.

    @ivar success: A flag which is set to C{True} when the event callback is
        called.

    @ivar logThreadID: The id of the thread in which the C{logPrefix} method is
        called.

    @ivar eventThreadID: The id of the thread in which the event callback is
        called.

    @ivar connLostThreadID: The id of the thread in which the C{connectionLost}
        method is called.

    @ivar _finished: The L{Deferred} which will be fired when the event callback
        is called.
    cCs
||_dS(N(t	_finished(tselftfinished((sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyt__init__/scCstƒ|_dS(NR(RtlogThreadID(R((sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyt	logPrefix3scCs)t|_tƒ|_|jjdƒdS(N(tTruetsuccessRt
eventThreadIDRtcallbacktNone(R((sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pytoccurred8s	cCstdƒ‚dS(NsSome problem(tRuntimeError(R((sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pytbrokenOccurred>scCs
tdƒS(NsEntirely different problem(tEnvironmentError(R((sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pytreturnValueOccurredBscCs tƒ|_|jj|ƒdS(N(RtconnLostThreadIDRterrback(Rtreason((sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pytconnectionLostFsN(t__name__t
__module__t__doc__tFalseRRRRRR
RRRRR(((sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyRs					tWin32EventsTestsBuildercBsMeZdZegZd„Zd„Zd„Zd„Zd„Z	d„Z
RS(sD
    Builder defining tests relating to L{IReactorWin32Events}.
    cCs|jƒ}tt|ƒdS(sn
        An instance of the reactor has all of the methods defined on
        L{IReactorWin32Events}.
        N(tbuildReactorRR(Rtreactor((sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyttest_interfaceRscsÅtƒ}|jƒ‰tjdttdƒ}tƒ}|j‡fd†ƒt|ƒ}ˆj	||dƒˆj
tj|ƒ|jˆƒ|j
|jƒ|j||jƒ|j||jƒdS(sš
        When an event which has been added to the reactor is set, the action
        associated with the event is invoked in the reactor thread.
        cs
ˆjƒS(N(tstop(tignored(R!(sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyt<lambda>dsRN(RR t
win32eventtCreateEventRRRtaddCallbackRtaddEventtcallWhenRunningtSetEventt
runReactort
assertTrueRtassertEqualRR(RtreactorThreadIDteventR	tlistener((R!sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyt
test_addEvent[s		
cs¸g‰‡‡fd†}|jƒ‰tjdttdƒ}tƒ}t|ƒ}|j|ƒˆj||dƒˆj	tj
|ƒ|jˆƒ|j|j
ƒ|jtgˆƒdS(s{
        Using L{IReactorWin32Events.addEvent} does not change which thread is
        reported as the I/O thread.
        csˆjtƒƒˆjƒdS(N(tappendRR#(R$(R!tresults(sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pytchecktsRN(R R&R'RRRRR(R)R*R+R,R-RR.R
(RR5R0R	R1((R!R4sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyttest_ioThreadDoesNotChangens	

csÍtƒ}|jƒ‰tjdttdƒ}|jtƒtƒ}|j	‡fd†ƒt
|ƒ}ˆj||dƒˆjtj
|ƒ|jˆƒ|j||jƒ|jdt|jtƒƒƒdS(sÕ
        If the event handler raises an exception, the event is removed from the
        reactor and the handler's C{connectionLost} method is called in the I/O
        thread and the exception is logged.
        cs
ˆjƒS(N(R#(R$(R!(sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyR%sRiN(RR R&R'RRt
assertFailureRRR(RR)R*R+R,R.RtlentflushLoggedErrors(RR/R0R	R1((R!sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyttest_disconnectedOnErrorƒs	
cs®tƒ}|jƒ‰tjdttdƒ}|jtƒtƒ}|j	‡fd†ƒt
|ƒ}ˆj||dƒˆjtj
|ƒ|jˆƒ|j||jƒdS(sµ
        If the event handler returns a value, the event is removed from the
        reactor and the handler's C{connectionLost} method is called in the I/O
        thread.
        cs
ˆjƒS(N(R#(R$(R!(sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyR% sRN(RR R&R'RRR7RRR(RR)R*R+R,R.R(RR/R0R	R1((R!sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyttest_disconnectOnReturnValue–s	
cCs€|jƒ}tjdttdƒ}tƒ}t|ƒ}|j||dƒ|j|j	ƒ|j
|ƒ|jd|jƒdS(s¾
        Event handlers added with L{IReactorWin32Events.addEvent} do not have
        C{connectionLost} called on them if they are still active when the
        reactor shuts down.
        RN(
R R&R'RRRRR)R*R#R,tassertIdenticalR(RR!R0R	R1((sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyttest_notDisconnectedOnShutdown¨s	
(RRRRtrequiredInterfacesR"R2R6R:R;R=(((sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyRLs							(RtthreadRR&tImportErrorRtzope.interface.verifyRttwisted.python.threadableRttwisted.internet.interfacesRttwisted.internet.deferRt#twisted.internet.test.reactormixinsRtobjectRRtglobalstupdatetmakeTestCaseClasses(((sJ/usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyt<module>s

5k

Youez - 2016 - github.com/yon3zu
LinuXploit