Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/twisted/test/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pyc

ó
²“ƒNc@sždZddlmZddlmZddlmZddlmZm	Z	m
Z
defd„ƒYZdefd	„ƒYZd
eej
fd„ƒYZdS(
s+
Test cases for twisted.protocols.stateful
iÿÿÿÿ(tTestCase(ttest_protocols(tStatefulProtocol(tpacktunpacktcalcsizetMyInt32StringReceivercBs\eZdZdZdZeeƒZd„Zd„Zd„Z	d„Z
d„Zd„ZRS(	s)
    A stateful Int32StringReceiver.
    i٠s!IcCs
|jdfS(Ni(t
_getHeader(tself((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pytgetInitialStatescCs|jjƒdS(N(t	transporttloseConnection(Rtlength((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pytlengthLimitExceededscCs?td|ƒ\}||jkr2|j|ƒdS|j|fS(Ns!i(Rt
MAX_LENGTHR
t
_getString(RtmsgR((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pyRs

cCs|j|ƒ|jdfS(Ni(tstringReceivedR(RR((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pyR%s
cCs
t‚dS(s 
        Override this.
        N(tNotImplementedError(RR((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pyR)scCs*|jjt|jt|ƒƒ|ƒdS(sS
        Send an int32-prefixed string to the other end of the connection.
        N(R
twriteRtstructFormattlen(Rtdata((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pyt
sendString/s(
t__name__t
__module__t__doc__RRRtprefixLengthR	R
RRRR(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pyRs					t	TestInt32cBs/eZd„Zd„ZdZdZd„ZRS(cCs
g|_dS(N(treceived(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pytconnectionMade7scCs|jj|ƒdS(N(Rtappend(Rts((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pyR:si2icCs
d|_dS(Ni(tclosed(Rtreason((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pytconnectionLost@s(RRRRRR!R#(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pyR6s
		t
Int32TestCasecBs;eZeZddgZdgZdddgZd„ZRS(	tatbis
aaaaaatshello theretcCsr|jƒ}d}x2|jdD]#}|tdt|ƒƒ|7}q W|j|ƒ|j|j|jdƒdS(NR(is!i(tgetProtocoltstringsRRtdataReceivedtassertEqualR(RtrtbigR ((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pyttest_bigReceiveJs!
tbbbbbbbbbbbbbbbb(RRRtprotocolR*tillegalStringstpartialStringsR/(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pyR$Ds
	N(Rttwisted.trial.unittestRttwisted.testRttwisted.protocols.statefulRtstructRRRRRtIntNTestCaseMixinR$(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_stateful.pyt<module>s&