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_posixbase.pyc
ó
ê=Nc@sHdZddlmZddlmZddlmZddlmZm	Z	ddl
mZdZ
yddlmZWnek
rdZ
nXdd	lmZdd
lmZddlmZdefd
„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdS(s>
Tests for L{twisted.internet.posixbase} and supporting code.
iÿÿÿÿ(tset(tTestCase(tDeferred(tPosixReactorBaset_Waker(t
ServerFactory(tunixs)Platform does not support AF_UNIX sockets(tPort(treactor(tClientPrototTrivialReactorcBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCs#i|_i|_tj|ƒdS(N(t_readerst_writersRt__init__(tself((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR
s		cCst|j|<dS(N(tTrueR(Rtreader((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyt	addReader scCs|j|=dS(N(R(RR((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pytremoveReader$scCst|j|<dS(N(RR(Rtwriter((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyt	addWriter(scCs|j|=dS(N(R(RR((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pytremoveWriter,s(t__name__t
__module__R
RRRR(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR
s
				tPosixReactorBaseTestscBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	RS(s(
    Tests for L{PosixReactorBase}.
    cCsC|j|jtƒ|j|j|jƒ|j|j|jƒdS(N(tassertIsInstancetwakerRtassertInt_internalReadersR(RR((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyt_checkWaker6scCstƒ}|j|ƒdS(s
        When L{PosixReactorBase} is instantiated, it creates a waker and adds
        it to its internal readers set.
        N(R
R(RR((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyttest_wakerIsInternalReader<s	cCs|tƒ}tƒ}|jj|ƒ|j|ƒ|j|j|jƒ|j|ƒ|j	||jƒ|j	||jƒdS(s‹
        Any L{IReadDescriptors} in L{PosixReactorBase._internalReaders} are
        left alone by L{PosixReactorBase._removeAll}.
        N(
R
tobjectRtaddRt
_removeAllRRRR(RRtextra((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyt"test_removeAllSkipsInternalReadersEs		

cCs™tƒ}tƒ}tƒ}|j|ƒ|j|ƒ|j|j|jƒ}|jt|ƒt||gƒƒ|j	||jƒ|j	||jƒdS(s†
        L{PosixReactorBase._removeAll} returns a list of removed
        L{IReadDescriptor} and L{IWriteDescriptor} objects.
        N(
R
RRRR!RRtassertEqualRtassertNotIn(RRRRtremoved((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyt'test_removeAllReturnsRemovedDescriptorsTs			

"cCsvddlm}|j|j|jgƒ}|jt|ƒdƒ|j|ddtƒ|jd|ddƒdS(	sœ
        L{twisted.internet.interfaces.IReactorArbitrary} is redundant with
        L{twisted.internet.interfaces.IReactorFDSet} and is deprecated.
        iÿÿÿÿ(t
interfacesiitcategorysbtwisted.internet.interfaces.IReactorArbitrary was deprecated in Twisted 10.1.0: See IReactorFDSet.tmessageN(ttwisted.internetR(tIReactorArbitraryt
flushWarningst"test_IReactorArbitraryIsDeprecatedR$tlentDeprecationWarning(RR(t
warningsShown((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR.escCsˆdd	d„ƒY}tƒ}|j|ƒ|j|jgƒ}|jt|ƒdƒ|j|ddtƒ|jd|ddƒdS(
sÆ
        L{PosixReactorBase} implements the deprecated L{IReactorArbitrary}, and
        L{PosixReactorBase.listenWith} is a part of that interface. To avoid
        unnecessary deprecation warnings when importing posixbase, the
        L{twisted.internet.interfaces._IReactorArbitrary} alias that doesn't
        have the deprecation warning is imported, and instead
        L{PosixReactorBase.listenWith} generates its own deprecation warning.
        tfakePortcBseZd„Zd„ZRS(c_sdS(N((Rtargstkw((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR
scSsdS(N((R((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pytstartListening„s(RRR
R5(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR2€s	iiR)s@listenWith is deprecated since Twisted 10.1.  See IReactorFDSet.R*N((R
t
listenWithR-ttest_listenWithIsDeprecatedR$R/R0(RR2Rtwarnings((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR7ws		
cCsˆdd	d„ƒY}tƒ}|j|ƒ|j|jgƒ}|jt|ƒdƒ|j|ddtƒ|jd|ddƒdS(
sÈ
        L{PosixReactorBase} implements the deprecated L{IReactorArbitrary}, and
        L{PosixReactorBase.connectWith} is a part of that interface. To avoid
        unnecessary deprecation warnings when importing posixbase, the
        L{twisted.internet.interfaces._IReactorArbitrary} alias that doesn't
        have the deprecation warning is imported, and instead
        L{PosixReactorBase.connectWith} generates its own deprecation warning.
        t
fakeConnectorcBseZd„Zd„ZRS(c_sdS(N((RR3R4((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR
scSsdS(N((R((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pytconnect s(RRR
R:(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR9œs	iiR)sAconnectWith is deprecated since Twisted 10.1.  See IReactorFDSet.R*N((R
tconnectWithR-ttest_connectWithIsDeprecatedR$R/R0(RR9RR8((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR<“s		
(
RRt__doc__RRR#R'R.R7R<(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR1s							tTCPPortTestscBs/eZdZeeeƒs$dZnd„ZRS(s1
    Tests for L{twisted.internet.tcp.Port}.
    sNon-posixbase reactorcCs=tdtƒƒ}t|_d„|_|j|jƒtƒS(sƒ
        L{Port.stopListening} returns a L{Deferred} which errbacks if
        L{Port.connectionLost} raises an exception.
        i90cSsddS(Nii((treason((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyt<lambda>¿s(RRRt	connectedtconnectionLostt
assertFailuret
stopListeningtZeroDivisionError(Rtport((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyttest_connectionLostFailed¸s	(RRR=t
isinstanceRRtskipRG(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR>°s	tTimeoutReportReactorcBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(sà
    A reactor which is just barely runnable and which cannot monitor any
    readers or writers, and which fires a L{Deferred} with the timeout
    passed to its C{doIteration} method as soon as that method is invoked.
    cCs&tj|ƒtƒ|_d|_dS(Nid(RR
RtiterationTimeouttnow(R((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR
Ês
cCsdS(s—
        Ignore the reader.  This is necessary because the waker will be
        added.  However, we won't actually monitor it for any events.
        N((RR((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyRÐscCsgS(s°
        There are no readers or writers, so there is nothing to remove.
        This will be called when the reactor stops, though, so it must be
        implemented.
        ((R((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyt	removeAll×scCs|jS(sx
        Override the real clock with a deterministic one that can be easily
        controlled in a unit test.
        (RL(R((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pytsecondsàscCs2|j}|dk	r.d|_|j|ƒndS(N(RKtNonetcallback(Rttimeouttd((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pytdoIterationès		(RRR=R
RRMRNRS(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyRJÄs					tIterationTimeoutTestscBsVeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
RS(	s
    Tests for the timeout argument L{PosixReactorBase.run} calls
    L{PosixReactorBase.doIteration} with in the presence of various delayed
    calls.
    csDg}ˆjj|jƒˆjj‡fd†ƒˆjƒ|dS(Ncs
ˆjƒS(N(tstop(tignored(R(sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR@ùsi(RKtaddCallbacktappendtrun(RRRQ((RsH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyt_checkIterationTimeoutös

cCs,tƒ}|j|ƒ}|j|dƒdS(sl
        If there are no delayed calls, C{doIteration} is called with a
        timeout of C{None}.
        N(RJRZR$RO(RRRQ((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyttest_noCallsþs	cCs?tƒ}|jdd„ƒ|j|ƒ}|j|dƒdS(sÁ
        If there is a delayed call, C{doIteration} is called with a timeout
        which is the difference between the current time and the time at
        which that call is to run.
        idcSsdS(N(RO(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR@sN(RJt	callLaterRZR$(RRRQ((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyttest_delayedCalls	cCsNtƒ}|jdd„ƒ|jd7_|j|ƒ}|j|dƒdS(s¯
        If a delayed call is scheduled and then some time passes, the
        timeout passed to C{doIteration} is reduced by the amount of time
        which passed.
        idcSsdS(N(RO(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR@siiKN(RJR\RLRZR$(RRRQ((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyttest_timePassess
	cCsetƒ}|jdd„ƒ|jdd„ƒ|jdd„ƒ|j|ƒ}|j|dƒdS(sÜ
        If there are several delayed calls, C{doIteration} is called with a
        timeout which is the difference between the current time and the
        time at which the earlier of the two calls is to run.
        i2cSsdS(N(RO(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR@(si
cSsdS(N(RO(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR@)sidcSsdS(N(RO(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR@*sN(RJR\RZR$(RRRQ((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyttest_multipleDelayedCalls!s	cCs]tƒ}|jdd„ƒ}|jd7_|jdƒ|j|ƒ}|j|dƒdS(sÀ
        If a delayed call is reset, the timeout passed to C{doIteration} is
        based on the interval between the time when reset is called and the
        new delay of the call.
        i2cSsdS(N(RO(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR@6siiN(RJR\RLtresetRZR$(RRtcallRQ((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyttest_resetDelayedCall/s	
cCs]tƒ}|jdd„ƒ}|jd7_|jdƒ|j|ƒ}|j|dƒdS(sñ
        If a delayed call is re-delayed, the timeout passed to
        C{doIteration} is based on the remaining time before the call would
        have been made and the additional amount of time passed to the delay
        method.
        i2cSsdS(N(RO(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR@Esi
ii<N(RJR\RLtdelayRZR$(RRRaRQ((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyttest_delayDelayedCall=s	
cCsKtƒ}|jdd„ƒ}|jƒ|j|ƒ}|j|dƒdS(sp
        If the only delayed call is canceled, C{None} is the timeout passed
        to C{doIteration}.
        i2cSsdS(N(RO(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyR@RsN(RJR\tcancelRZR$RO(RRRaRQ((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyttest_cancelDelayedCallLs
	
(RRR=RZR[R]R^R_RbRdRf(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyRTðs		
		
			tConnectedDatagramPortTestCasecBs5eZdZedk	r!eZnd„Zd„ZRS(s/
    Test connected datagram UNIX sockets.
    cs>‡fd†}tjdtƒƒ}||_|jdƒdS(s
        L{ConnectedDatagramPort} does not call the deprecated C{loseConnection}
        in L{ConnectedDatagramPort.connectionFailed}.
        csˆjdƒdS(s€
            Dummy C{loseConnection} method. C{loseConnection} is deprecated and
            should not get called.
            s7loseConnection is deprecated and should not get called.N(tfail((R(sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pytloseConnectionfstgoodbyeN(RtConnectedDatagramPortROR	RitconnectionFailed(RRiRF((RsH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyt-test_connectionFailedDoesntCallLoseConnectionas	csZtˆ_‡fd†}tjdtƒƒ}||_|jdƒˆjˆjt	ƒdS(sÁ
        L{ConnectedDatagramPort} calls L{ConnectedDatagramPort.stopListening}
        instead of the deprecated C{loseConnection} in
        L{ConnectedDatagramPort.connectionFailed}.
        cs
tˆ_dS(s8
            Dummy C{stopListening} method.
            N(Rtcalled((R(sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyRDzsRjN(
tFalseRnRRkROR	RDRlR$R(RRDRF((RsH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyt'test_connectionFailedCallsStopListeningrs		
N(RRR=tskipSocketsRORIRmRp(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyRgYs
		N(R=ttwisted.python.compatRttwisted.trial.unittestRttwisted.internet.deferRttwisted.internet.posixbaseRRttwisted.internet.protocolRRORqR+RtImportErrorttwisted.internet.tcpRRttwisted.test.test_unixR	R
RR>RJRTRg(((sH/usr/lib/python2.7/dist-packages/twisted/internet/test/test_posixbase.pyt<module>s&

,i

Youez - 2016 - github.com/yon3zu
LinuXploit