+
    Dfj                         R t ^ RIHtHtHt ^ RIHt ^ RIHt ^ RI	H
t
  ! R R]4      t ! R R]4      t ! R	 R
]
]P                  4      tR# )z+
Test cases for twisted.protocols.stateful
)calcsizepackunpack)StatefulProtocol)
test_basic)TestCasec                   `   a  ] tR t^t o RtRtRt]! ]4      tR t	R t
R tR tR tR	 tR
tV tR# )MyInt32StringReceiverz!
A stateful Int32StringReceiver.
i z!Ic                    V P                   ^3#    )
_getHeaderselfs   &</usr/lib/python3/dist-packages/twisted/test/test_stateful.pygetInitialState%MyInt32StringReceiver.getInitialState   s    !!    c                :    V P                   P                  4        R # N)	transportloseConnection)r   lengths   &&r   lengthLimitExceeded)MyInt32StringReceiver.lengthLimitExceeded   s    %%'r   c                    \        R V4      w  pW P                  8  d   V P                  V4       R# V P                  V3# )!iN)r   
MAX_LENGTHr   
_getString)r   msgr   s   && r   r    MyInt32StringReceiver._getHeader   s:    4%	OO#$$V,&&r   c                @    V P                  V4       V P                  ^3# r   )stringReceivedr   r   r   s   &&r   r    MyInt32StringReceiver._getString&   s    C !!r   c                    \         h)z
Override this.
)NotImplementedErrorr#   s   &&r   r"   $MyInt32StringReceiver.stringReceived*   s
     "!r   c                    V P                   P                  \        V P                  \	        V4      4      V,           4       R# )zC
Send an int32-prefixed string to the other end of the connection.
N)r   writer   structFormatlen)r   datas   &&r   
sendString MyInt32StringReceiver.sendString0   s,     	T$"3"3SY?$FGr    N)__name__
__module____qualname____firstlineno____doc__r   r*   r   prefixLengthr   r   r   r   r"   r-   __static_attributes____classdictcell____classdict__s   @r   r	   r	      sE      JLL)L"('""H Hr   r	   c                   :   a  ] tR t^7t o R tR t^2t^ tR tRt	V t
R# )	TestInt32c                    . V n         R # r   )receivedr   s   &r   connectionMadeTestInt32.connectionMade8   s	    r   c                <    V P                   P                  V4       R # r   )r=   append)r   ss   &&r   r"   TestInt32.stringReceived;   s    Qr   c                    ^V n         R# )   N)closed)r   reasons   &&r   connectionLostTestInt32.connectionLostA   s	    r   )rF   r=   N)r0   r1   r2   r3   r>   r"   r   rF   rH   r6   r7   r8   s   @r   r;   r;   7   s%       JF r   r;   c                   @   a  ] tR t^Et o ]tRR.tR.t. ROtR t	Rt
V tR# )
Int32Tests   as
      aaaaaac                    V P                  4       pR pV P                  ^,           F&  pV\        R\        V4      4      V,           ,          pK(  	  VP	                  V4       V P                  VP                  V P                  ^,          4       R# )r   r   N)getProtocolstringsr   r+   dataReceivedassertEqualr=   )r   rbigrB   s   &   r   test_bigReceiveInt32Tests.test_bigReceiveK   sn    !!A4c!f%))C "	sT\\A%56r   r/   Ns   bbbbbbbbbbbbbbbb)s      s   hello therer   )r0   r1   r2   r3   r;   protocolrO   illegalStringspartialStringsrT   r6   r7   r8   s   @r   rK   rK   E   s+     HYG/0N;N7 7r   rK   N)r4   structr   r   r   twisted.protocols.statefulr   twisted.protocols.testr   twisted.trial.unittestr   r	   r;   IntNTestCaseMixinrK   r/   r   r   <module>r^      sL   
 * ) 7 - +$H, $HN% 7:77 7r   