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/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyc
ó
0”Nc@s1dZddlmZmZmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZm
Z
mZmZmZddlmZd	ejfd
„ƒYZdejfd„ƒYZd
ejfd„ƒYZdejfd„ƒYZdejfd„ƒYZdejfd„ƒYZdejfd„ƒYZdej fd„ƒYZ dejfd„ƒYZ!dejfd„ƒYZ"dejej#fd„ƒYZ$dejfd „ƒYZ%d!ejfd"„ƒYZ&d#efd$„ƒYZ'd%ej(fd&„ƒYZ)d'ejfd(„ƒYZ*d)S(*s
Test code for policies.
iÿÿÿÿ(t	Interfacet
implementst
implementedBy(tStringIO(tunittest(tStringTransport(t StringTransportWithDisconnection(tprotocoltreactortaddresstdeferttask(tpoliciestSimpleProtocolcBs<eZdZZdZd„Zd„Zd„Zd„ZRS(itcCs"tjƒ|_tjƒ|_dS(N(R
tDeferredt
dConnectedt
dDisconnected(tself((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyt__init__scCsd|_|jjdƒdS(NiR(t	connectedRtcallback(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pytconnectionMades	cCsd|_|jjdƒdS(NiR(tdisconnectedRR(Rtreason((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pytconnectionLost"s	cCs|j|7_dS(N(tbuffer(Rtdata((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pytdataReceived&s(	t__name__t
__module__RRRRRRR(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR
s
			tSillyFactorycBseZd„Zd„ZRS(cCs
||_dS(N(tp(RR ((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR-scCs|jS(N(R (Rtaddr((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyt
buildProtocol0s(RRRR"(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR+s	tEchoProtocolcBs2eZeZd„Zd„Zd„Zd„ZRS(cCs
t|_dS(N(tTruetpaused(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pytpauseProducing7scCs
t|_dS(N(tFalseR%(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pytresumeProducing:scCsdS(N((R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyt
stopProducing=scCs|jj|ƒdS(N(t	transporttwrite(RR((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR@s(RRR'R%R&R(R)R(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR#4s
			tServercBseZdZeZRS(s8
    A simple server factory using L{EchoProtocol}.
    (RRt__doc__R#R(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR,EstTestableThrottlingFactorycBs eZdZd„Zd„ZRS(sH
    L{policies.ThrottlingFactory} using a L{task.Clock} for tests.
    cOs#tjj|||Ž||_dS(s˜
        @param clock: object providing a callLater method that can be used
            for tests.
        @type clock: C{task.Clock} or alike.
        N(RtThrottlingFactoryRtclock(RR0targstkwargs((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRRscCs|jj||ƒS(s0
        Forward to the testable clock.
        (R0t	callLater(Rtperiodtfunc((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR3\s(RRR-RR3(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR.Ms	
tTestableTimeoutFactorycBs eZdZd„Zd„ZRS(sE
    L{policies.TimeoutFactory} using a L{task.Clock} for tests.
    cOs#tjj|||Ž||_dS(s˜
        @param clock: object providing a callLater method that can be used
            for tests.
        @type clock: C{task.Clock} or alike.
        N(RtTimeoutFactoryRR0(RR0R1R2((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRiscCs|jj||ƒS(s0
        Forward to the testable clock.
        (R0R3(RR4R5((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR3ss(RRR-RR3(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR6ds	
tWrapperTestCasecBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s>
    Tests for L{WrappingFactory} and L{ProtocolWrapper}.
    cCsPtƒ}tj|ƒ}|jtjdddƒƒ}|j|jj|ƒdS(sf
        Make sure protocol.factory is the wrapped factory, not the wrapping
        factory.
        tTCPs	127.0.0.1i#N(	R,RtWrappingFactoryR"R	tIPv4AddresstassertIdenticaltwrappedProtocoltfactory(RtftwfR ((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_protocolFactoryAttributes	csdtfd„ƒY‰dd‡fd†ƒY}ttjƒtjƒ}tjtjdƒ|ƒ}|j|ƒƒ|j	ˆj
|jƒƒdS(s²
        The transport wrapper passed to the wrapped protocol's
        C{makeConnection} provides the same interfaces as are provided by the
        original transport.
        tIStubTransportcBseZRS((RR(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRBst
StubTransportcseZeˆƒRS((RRR((RB(s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRC“sN((RRRtProtocolWrapperRtProtocolR:tNonetmakeConnectiont
assertTruet
providedByR*(RRCtprototwrapper((RBs>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_transportInterfacesŠs

cCs2tƒ}tj|ƒ}|jd|jƒƒdS(sƒ
        L{WrappingFactory.logPrefix} is customized to mention both the original
        factory and the wrapping factory.
        sServer (WrappingFactory)N(R,RR:tassertEqualt	logPrefix(RtserverR>((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_factoryLogPrefix¦s	cCsHdtfd„ƒY}|ƒ}tj|ƒ}|jd|jƒƒdS(s—
        If the wrapped factory doesn't have a L{logPrefix} method,
        L{WrappingFactory.logPrefix} falls back to the factory class name.
        t	NoFactorycBseZRS((RR(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRQµssNoFactory (WrappingFactory)N(tobjectRR:RMRN(RRQROR>((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_factoryLogPrefixFallback°s	cCsPtƒ}tj|ƒ}|jtjdddƒƒ}|jd|jƒƒdS(s{
        L{ProtocolWrapper.logPrefix} is customized to mention both the original
        protocol and the wrapper.
        R9s	127.0.0.1i#sEchoProtocol (ProtocolWrapper)N(R,RR:R"R	R;RMRN(RROR>R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_protocolLogPrefix½s		cCsodtfd„ƒY}tƒ}||_tj|ƒ}|jtjdddƒƒ}|jd|j	ƒƒdS(s™
        If the wrapped protocol doesn't have a L{logPrefix} method,
        L{ProtocolWrapper.logPrefix} falls back to the protocol class name.
        t
NoProtocolcBseZRS((RR(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRUÏsR9s	127.0.0.1i#sNoProtocol (ProtocolWrapper)N(
RRR,RRR:R"R	R;RMRN(RRUROR>R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_protocolLogPrefixFallbackÊs			(	RRR-RARLRPRSRTRV(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR8{s			
	
	
R:cBseZd„Zd„ZRS(cCs|S(N((tsR?R ((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyt<lambda>ÝscCs$tjj|ƒ|jjdƒdS(N(RR:tstartFactorytdeferredRRF(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRYßs(RRRRY(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR:Üs	tThrottlingTestCasecBs)eZdZd„Zd„Zd„ZRS(s2
    Tests for L{policies.ThrottlingFactory}.
    c
smtƒ}gtdƒD]}tƒ^q\‰‰‰‰tj|dƒ‰tˆƒ}tjƒ|_t	j
d|ddƒ‰ˆjƒj‰‡‡‡‡fd†}‡‡‡‡‡fd†}‡fd†}‡‡fd	†}‡‡fd
†}‡‡‡fd†}	|jj
|ƒ|jj
|ƒ|jj
|ƒ|jj
|ƒ|jj
|ƒ|jj
|	ƒ|jS(sQ
        Full test using a custom server limiting number of connections.
        iiit	interfaces	127.0.0.1csXtjdˆtˆƒƒˆjj‡‡fd†ƒˆjj‡‡fd†ƒˆjS(Ns	127.0.0.1cstjdˆtˆƒƒS(Ns	127.0.0.1(Rt
connectTCPR(tr(tc2tn(s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRXûscstjdˆtˆƒƒS(Ns	127.0.0.1(RR]R(R^(tc3R`(s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRXýs(RR]RRtaddCallbackR(tresults(R`R_Ratc1(s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyt_connect123øs		cs“ˆjgˆˆˆfD]}|j^qdddgƒˆjgˆˆˆfD]}|j^qNdddgƒˆjtˆjjƒƒdƒ|S(Niii(RMRRtlent	protocolstkeys(Rctc(ttServerRRaR_Rd(s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyt	_check123s88csˆjjƒˆjS(N(R*tloseConnectionR(Rc(Rd(s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyt_lose1s
cs tjdˆtˆƒƒˆjS(Ns	127.0.0.1(RR]RR(Rc(tc4R`(s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyt	_connect4scs*ˆjˆjdƒˆjˆjdƒ|S(Nii(RMRR(Rc(RRn(s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyt_check4scsLx!ˆˆfD]}|jjƒq
WtjtjˆjƒˆjˆjgƒS(N(R*RlR
tDeferredListt
maybeDeferredt
stopListeningR(RcRi(R R_Rn(s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyt_cleanups(R,trangeR
RR/R:R
RRZRt	listenTCPtgetHosttportRb(
RROtitwrapTServerReRkRmRoRpRt((RjRRaR_RdRnR`R s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyt
test_limitês(	.cCs3tƒ}ttjƒ|ddƒ}|jtjdddƒƒ}tƒ}||_|j	|ƒ|j
|_|jdƒ|jdƒ|j
|jƒdƒ|j
|jd	ƒ|j|j
jƒ|jjd
ƒ|j
|jdƒ|j|j
jƒ|jjd
ƒ|j
|jdƒ|j|j
jƒdS(se
        Check the writeLimit parameter: write data, and check for the pause
        status.
        t
writeLimiti
R9s	127.0.0.1it
0123456789t
abcdefghijt0123456789abcdefghijigÍÌÌÌÌÌð?N(R,R.RtClockR"R	R;RRRGR=tproducerRRMtvaluetwrittenThisSecondtassertFalseR%R0tadvanceRH(RRORjRxttr((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_writeLimit%s$			


cCsÍtƒ}ttjƒ|ddƒ}|jtjdddƒƒ}tƒ}||_|j	|ƒ|j
dƒ|j
dƒ|j|jƒdƒ|j|j
d	ƒ|jjd
ƒ|j|j
dƒ|j|jdƒ|jjd
ƒ|j|j
dƒ|j|jdƒ|jƒ|j
dƒ|j
dƒ|j|jƒdƒ|j|j
d	ƒ|jjd
ƒ|j|j
dƒ|j|jdƒ|jjd
ƒ|j|j
dƒ|j|jdƒd
S(sb
        Check the readLimit parameter: read data and check for the pause
        status.
        t	readLimiti
R9s	127.0.0.1iR}R~RigÍÌÌÌÌÌð?R%t	producingN(R,R.RR€R"R	R;RRRGRRMR‚treadThisSecondR0R…t
producerStatetclear(RRORjRxR†((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_readLimitDs6			





(RRR-R{R‡R(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR[ås	;	tTimeoutTestCasecBs2eZdZd„Zd„Zd„Zd„ZRS(s/
    Tests for L{policies.TimeoutFactory}.
    cCs’tjƒ|_tjƒ}t|_t|j|dƒ|_|jjt	j
dddƒƒ|_tƒ|_
|j|j
_|jj|j
ƒdS(sq
        Create a testable, deterministic clock, and a set of
        server factory/protocol/transport.
        iR9s	127.0.0.1i90N(RR€R0Rt
ServerFactoryR
R6R>R"R	R;RJRR*RG(RtwrappedFactory((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pytsetUprs		cCse|jjdddddgƒ|j|jjjƒ|jjddgƒ|j|jjjƒdS(s¶
        Make sure that when a TimeoutFactory accepts a connection, it will
        time out that connection if no data is read or written within the
        timeout period.
        ggà?gð?gš™™™™™Ù?gš™™™™™É?N(R0tpumptfailIfRJR=Rt
failUnless(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_timeout‚scCsä|jjdddgƒ|j|jjjƒ|jjdƒ|jjdddgƒ|j|jjjƒ|jjdgdƒ|jjdddgƒ|j|jjjƒ|jjddgƒ|j|jjjƒdS(	s’
        Make sure that writing data to a transport from a protocol
        constructed by a TimeoutFactory resets the timeout countdown.
        ggà?gð?sbytes bytes bytestbytesig@N(	R0R’R“RJR=RR+t
writeSequenceR”(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_sendAvoidsTimeout‘scCs¡|jjdddgƒ|j|jjjƒ|jjdƒ|jjdddgƒ|j|jjjƒ|jjdddgƒ|j|jjjƒdS(sR
        Make sure that receiving data also resets the timeout countdown.
        ggð?gà?sbytes bytes bytesN(R0R’R“RJR=RRR”(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_receiveAvoidsTimeout®s(RRR-R‘R•R˜R™(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRŽms
			t
TimeoutTestercBsSeZdZdZeZd„Zd„Zd„Zdd„Z
d„Zd„ZRS(	s”
    A testable protocol with timeout facility.

    @ivar timedOut: set to C{True} if a timeout has been detected.
    @type timedOut: C{bool}
    icCs
||_dS(sF
        Initialize the protocol with a C{task.Clock} object.
        N(R0(RR0((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRÎscCs|j|jƒdS(s3
        Upon connection, set the timeout.
        N(t
setTimeoutttimeOut(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRÕscCs!|jƒtjj||ƒdS(s,
        Reset the timeout on data.
        N(tresetTimeoutRRER(RR((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRÜs
cCs|jdƒdS(sD
        On connection lost, cancel all timeout operations.
        N(R›RF(RR((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRäscCs
t|_dS(sX
        Flags the timedOut variable to indicate the timeout of the connection.
        N(R$ttimedOut(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttimeoutConnectionëscOs|jj||||ŽS(sD
        Override callLater to use the deterministic clock.
        (R0R3(RttimeoutR5R1R2((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR3òsN(
RRR-RœR'RžRRRRFRRŸR3(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRšÄs				tTestTimeoutcBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	RS(s-
    Tests for L{policies.TimeoutMixin}.
    cCs%tjƒ|_t|jƒ|_dS(sY
        Create a testable, deterministic clock and a C{TimeoutTester} instance.
        N(RR€R0RšRJ(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR‘ÿscCs0|jjdƒ|jt|jjƒdƒdS(sg
        Test that the callLater of the clock is used instead of
        C{reactor.callLater}.
        i
iN(RJR›RMRfR0tcalls(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_overriddenCallLaterscCso|jjtƒƒ|jjddddgƒ|j|jjƒ|jjddgƒ|j|jjƒdS(sq
        Check that the protocol does timeout at the time specified by its
        C{timeOut} attribute.
        igà?gð?N(RJRGRR0R’R“RžR”(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR•s
cCs®|jjtƒƒ|jjddddgƒ|j|jjƒ|jjdƒ|jjddddgƒ|j|jjƒ|jjddgƒ|j|jjƒdS(sV
        Check that receiving data is delaying the timeout of the connection.
        igà?gð?shello thereN(	RJRGRR0R’R“RžRR”(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_noTimeoutscCs›d|j_|jjtƒƒ|jjdƒ|j|jjdƒ|jjddgƒ|j	|jj
ƒ|jjddgƒ|j|jj
ƒdS(sy
        Check that setting a new value for timeout cancel the previous value
        and install a new timeout.
        iigÍÌÌÌÌÌì?gš™™™™™É?N(RFRJRœRGRR›RMR0R’R“RžR”(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_resetTimeout-scCsxd|j_|jjtƒƒ|jjdƒ|j|jjdƒ|jjddddgƒ|j	|jj
ƒdS(sO
        Setting the timeout to C{None} cancel any timeout operations.
        iiN(RJRœRGRR›RFRMR0R’R“Rž(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_cancelTimeout>scCsŠd|j_|j|jjdƒdƒ|j|jjdƒdƒ|j|jjdƒdƒ|j|jjdƒ|jjdƒdS(sM
        setTimeout should return the value of the previous timeout.
        ii
iN(RJRœRMR›RF(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_returnLs(
RRR-R‘R£R•R¤R¥R¦R§(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR¡ús							t$LimitTotalConnectionsFactoryTestCasecBs eZdZd„Zd„ZRS(s/Tests for policies.LimitTotalConnectionsFactorycCs³tjƒ}tj|_|jd|jƒ|jdƒ}|jd|jƒ|jdƒ}|jd|jƒ|jdƒ|jd|jƒ|jdƒ|jd|jƒdS(Niii(	RtLimitTotalConnectionsFactoryRRERMtconnectionCountR"RFR(RR>tp1tp2((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttestConnectionCounting^s

cs6tjƒ‰tjˆ_dˆ_ˆjdƒ}|jd|ƒ|jdˆj	ƒ|jdˆjdƒƒ|jdˆj	ƒdtjf‡fd†ƒY}|ˆ_
tˆ_ˆjdƒ}|j
dƒ|jtˆjƒ|jdˆj	ƒ|jdƒ|jdˆj	ƒ|jdƒ|jdˆj	ƒdS(NitOverflowProtocolcseZ‡fd†ZRS(cs
tˆ_dS(N(R$t
overflowed(R(R>(s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR„s(RRR((R>(s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR®ƒsii(RR©RREtconnectionLimitR"RFtassertNotEqualRMRªtoverflowProtocolR'R¯RGR$R(RR R®top((R>s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttestConnectionLimitingrs&			


(RRR-R­R´(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR¨\s	tWriteSequenceEchoProtocolcBseZd„ZRS(cCs?|jdƒdkr+|jj|gƒntj||ƒdS(Nsvector!iÿÿÿÿ(tfindR*R—R#R(RR–((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR™s(RRR(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyRµ˜stTestLoggingFactorycBseZdZd„ZRS(cCs.|jdkstdƒ‚tƒ|_|jS(Nsopen() called too many times(topenFileRFtAssertionErrorR(Rtname((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pytopen¡sN(RRRFR¸R»(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR·ŸstLoggingFactoryTestCasecBs eZdZd„Zd„ZRS(s6
    Tests for L{policies.TrafficLoggingFactory}.
    cCsYtƒ}t|_tƒ}t|dƒ}|jd
ƒ}||_|j|ƒ|jjƒ}|j	d|kd|fƒ|j
|jƒƒ|jdƒ|jjƒ}|j
d|ƒ|j
d|ƒ|j|jƒdƒ|jƒ|jd	ƒ|jjƒ}|j
d
|ƒ|j|jƒd	ƒ|jƒ|jjƒ}|j
d|ƒdS(sQ
        Check the output produced by L{policies.TrafficLoggingFactory}.
        ttests1.2.3.4i.t*s* not found in %rshere are some bytessC 1: 'here are some bytes'sS 1: 'here are some bytes's"prepare for vector! to the extremes,SV 1: ['prepare for vector! to the extreme']tConnectionDoneN(s1.2.3.4i.(R,RµRRR·R"RGR¸tgetvalueR”R“R‚RtassertInRMRŒRl(RRttR?R tv((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_thingsGetLogged­s.				




cCs•tƒ}t|dƒ}|j|jdƒ|jd	ƒ|j|jdƒd|_|jd
ƒ|j|jdƒ|jƒ|j|jdƒdS(sG
        Test counter management with the resetCounter method.
        R½is1.2.3.4i.ii/iN(s1.2.3.4i.(s1.2.3.4i/(R,R·RMt_counterR"RFR¸tresetCounter(RRR?((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyttest_counterÐs	
	

(RRR-RÄRÇ(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyR¼¨s	#N(+R-tzope.interfaceRRRRt
twisted.trialRttwisted.test.proto_helpersRRttwisted.internetRRR	R
Rttwisted.protocolsRRER
t
ClientFactoryRR#RR,R/R.R7R6tTestCaseR8R:R[RŽtTimeoutMixinRšR¡R¨RµtTrafficLoggingFactoryR·R¼(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_policies.pyt<module>s.(	a	ˆW6b<	

Youez - 2016 - github.com/yon3zu
LinuXploit