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_core.pyc
ó
ê=Nc@sëdZeZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZddl
mZdefd„ƒYZd	eefd
„ƒYZdefd„ƒYZeƒjejƒƒeƒjejƒƒdS(
s/
Tests for implementations of L{IReactorCore}.
iÿÿÿÿN(tFileDescriptor(tReactorAlreadyRunningtReactorNotRestartable(tDeferred(tReactorBuildertObjectModelIntegrationMixincBseZdZd„ZRS(sN
    Helpers for tests about the object model of reactor-related objects.
    cCsZ|j|tƒtjt|ƒƒ}x.|D]&}|jt|tƒd|fƒq,WdS(s.
        Assert that the given object is an instance of a new-style class and
        that there are no classic classes in the inheritance hierarchy of
        that class.

        This is a beneficial condition because PyPy is better able to
        optimize attribute lookup on such classes.
        s%r is not new-styleN(tassertIsInstancetobjecttinspecttgetmrottypet
assertTruet
issubclass(tselftinstancetmrotsubclass((sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pytassertFullyNewStyles	
(t__name__t
__module__t__doc__R(((sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyRstObjectModelIntegrationTestcBseZdZd„ZRS(sH
    Test details of object model integration against all reactors.
    cCs|jƒ}|j|ƒdS(s€
        Checks that all reactors on a platform have method resolution order
        containing only new style classes.
        N(tbuildReactorR(R
treactor((sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyttest_newstyleReactor/s(RRRR(((sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyR*stSystemEventTestsBuildercBsŒeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„ZRS(s{
    Builder defining tests relating to L{IReactorCore.addSystemEventTrigger}
    and L{IReactorCore.fireSystemEvent}.
    cCs#|jƒ}|jt|jƒdS(su
        C{reactor.stop()} raises L{RuntimeError} when called when the reactor
        has not been started.
        N(RtassertRaisestRuntimeErrortstop(R
R((sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyttest_stopWhenNotStarted>scCs@|jƒ}|j|jƒ|j|ƒ|jt|jƒdS(sr
        C{reactor.stop()} raises L{RuntimeError} when called after the reactor
        has been stopped.
        N(RtcallWhenRunningRt
runReactorRR(R
R((sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyttest_stopWhenAlreadyStoppedGs
cCso|jƒ}g}|j|jdƒ|j|jdƒ|j|jƒ|j|ƒ|j|ddgƒdS(sm
        Functions are run in the order that they were passed to
        L{reactor.callWhenRunning}.
        tfirsttsecondN(RRtappendRRtassertEqual(R
Rtevents((sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyttest_callWhenRunningOrderRs
cs×|jƒ‰i‰‡‡fd†}‡‡fd†}‡‡fd†}ˆjdd|ƒˆjdd|ƒˆjdd|ƒˆjˆjƒ|jˆiƒ|jˆƒ|jˆitd6td6td6ƒdS(	s¿
        The reactor is not running when C{"before"} C{"startup"} triggers are
        called and is running when C{"during"} and C{"after"} C{"startup"}
        triggers are called.
        csˆjˆd<dS(Ntbefore(trunning((tstateR(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyt
beforeStartuphscsˆjˆd<dS(Ntduring(R(((R)R(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyt
duringStartupjscsˆjˆd<dS(Ntafter(R(((R)R(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pytafterStartuplsR'tstartupR+R-N(RtaddSystemEventTriggerRRR$RtFalsetTrue(R
R*R,R.((RR)sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyttest_runningForStartupEvents`s 

csø|jƒ}d	g‰‡fd†}‡fd†}|jdd|ƒ|jdd|ƒd	g‰‡‡fd†}|jtd|ƒ|j|jƒ|jˆdd	ƒ|jˆdd	ƒ|j|ƒ|jˆddƒ|jˆddƒd	S(
se
        Signal handlers are installed in responsed to the C{"during"}
        C{"startup"}.
        csdˆd<dS(NR'i(((tphase(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyR*‚scsdˆd<dS(NR-i(((R4(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyR.„sR'R/R-csˆdˆd<dS(Ni((tsignumtaction(tsawPhaseR4(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyt
fakeSignalŠstsignaliN(	RtNoneR0tpatchR9RRR$R(R
RR*R.R8((R7R4sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyt)test_signalHandlersInstalledDuringStartup{s		
cs |jƒ}g‰|jdd‡fd†ƒ|jdd‡fd†ƒ|jdd‡fd†ƒ|j|jƒ|j|ƒ|jˆd	d
dgƒdS(s†
        C{reactor.stop()} fires all three phases of shutdown event triggers
        before it makes C{reactor.run()} return.
        R'tshutdowncs
ˆjdƒS(NR'R=(sbeforeR=(R#((R%(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyt<lambda>žsR+cs
ˆjdƒS(NR+R=(sduringsshutdown(R#((R%(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyR>¡sR-cs
ˆjdƒS(NR-R=(saftersshutdown(R#((R%(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyR>¤sN(sbeforesshutdown(sduringsshutdown(saftersshutdown(RR0RRRR$(R
R((R%sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyttest_stopShutDownEvents•s 
cs|jƒ‰g‰ˆjddˆjdƒ‡‡fd†}ˆj|ƒ|jˆgƒ|jˆƒ|jˆddgƒdS(sl
        C{"before"} C{"shutdown"} triggers are not run synchronously from
        L{reactor.stop}.
        R'R=sbefore shutdowncsˆjƒˆjdƒdS(Ntstopped(RR#((RR%(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pytstopItµs
R@N(RR0R#RR$R(R
RA((RR%sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyt(test_shutdownFiresTriggersAsynchronously¬s

csÂtg‰dtfd„ƒY}dtf‡fd†ƒY}|jƒ}t|ƒ|ƒgƒ‰‡fd†|_|j|jƒ|j|ƒ|jt	|j
tƒƒdƒ|jˆdƒdS(	sÔ
        A L{IFileDescriptor.connectionLost} implementation which raises an
        exception does not prevent the remaining L{IFileDescriptor}s from
        having their C{connectionLost} method called.
        tProblematicFileDescriptorcBseZd„ZRS(cSstdƒ‚dS(Nssimulated connectionLost error(R(R
treason((sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pytconnectionLostÈs(RRRE(((sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyRCÇstOKFileDescriptorcseZ‡fd†ZRS(cstˆd<dS(Ni(R2(R
RD(tlostOK(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyREÌs(RRRE((RG(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyRFËscsˆS(N(((tfds(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyR>×siiN(
R1RRtitert	removeAllRRRR$tlentflushLoggedErrorsRR(R
RCRFR((RHRGsC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyttest_shutdownDisconnectsCleanly¾s	
cshg‰‡‡‡fd†}ˆjƒ‰ˆj|ƒˆjˆjƒˆjˆƒˆjˆdgƒdS(s{
        C{reactor.run()} raises L{ReactorAlreadyRunning} when called when
        the reactor is already running.
        cs$ˆjtˆjƒˆjdƒdS(Nttested(RRtrunR#((R
RR%(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pytreentrantRunäsRNN(RRRRR$(R
RP((R
R%RsC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyttest_multipleRunÞs

cssg‰‡‡‡fd†}‡‡fd†‰|jƒ‰ˆjdd|ƒ|jˆƒ|jˆddgƒdS(sØ
        When there is a C{'before'} C{'startup'} trigger which returns an
        unfired L{Deferred}, C{reactor.run()} starts the reactor and does not
        return until after C{reactor.stop()} is called
        cs=ˆjdƒtƒ}|jˆƒˆjd|jdƒ|S(Nttriggeri(R#RtaddCallbackt	callLatertcallbackR:(td(RRUR%(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyRRõs

	
csˆjdƒˆjƒdS(NRU(R#R(tignored(R%R(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyRUûs
R'R/RRRUN(RR0RR$(R
RR((RUR%RsC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyt,test_runWithAsynchronousBeforeStartupTriggerîs
cCsk|jƒ}|jd|jƒ}tjƒ}|jdƒtjƒ|}|j|dkƒ|jƒdS(s6
        C{reactor.iterate()} does not block.
        iiiN(RRTtcrashttimetiteratet
failUnlesstcancel(R
Rtttstarttelapsed((sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyttest_iterates
csx|jƒ}g‰|jdd‡fd†ƒ|j|jd|jƒ|j|ƒ|j|jƒ|jˆdƒdS(sc
        C{reactor.crash()} stops the reactor and does not fire shutdown
        triggers.
        R'R=cs
ˆjdƒS(NR'R=(sbeforesshutdown(R#((R%(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyR>sis8Shutdown triggers invoked but they should not have been.N(RR0RRTRYRtassertFalseR((R
R((R%sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyt
test_crashs
csŠg‰‡‡fd†}|jƒ‰ˆj|ƒ|jˆƒ‡‡fd†}ˆj|ƒ|jˆƒ|jˆddtfgƒdS(sp
        C{reactor.run()} restarts the reactor after it has been stopped by
        C{reactor.crash()}.
        csˆjdƒˆjƒdS(NRY(R#RY((R%R(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyRY+s
cs$ˆjdˆjfƒˆjƒdS(NR(R#R(R((R%R(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyR1sRYRN(RRRR$R2(R
RYR((RR%sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyttest_runAfterCrash%s



csng‰‡‡‡fd†}ˆjƒ‰ˆjˆjƒˆjdd|ƒˆjˆƒˆjˆdgƒdS(s“
        C{reactor.run()} raises L{ReactorNotRestartable} when called when
        the reactor is being run after getting stopped priorly.
        cs$ˆjtˆjƒˆjdƒdS(NRN(RRROR#((R%R
R(sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pytrestart?sR-R=RNN(RRRR0RR$(R
Re((R
R%RsC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyttest_runAfterStop9s
(RRRRR R&R3R<R?RBRMRQRXRaRcRdRf(((sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyR9s									 					(RR
t
__metaclass__R9RZRttwisted.internet.abstractRttwisted.internet.errorRRttwisted.internet.deferRt#twisted.internet.test.reactormixinsRRRRRtglobalstupdatetmakeTestCaseClasses(((sC/usr/lib/python2.7/dist-packages/twisted/internet/test/test_core.pyt<module>sÿ

Youez - 2016 - github.com/yon3zu
LinuXploit