Current Path : /usr/lib/python2.7/dist-packages/twisted/test/ |
Current File : //usr/lib/python2.7/dist-packages/twisted/test/testutils.pyc |
ó f9=c @ s@ d d l m Z d d l m Z d d d „ ƒ YZ d „ Z d S( iÿÿÿÿ( t StringIO( t FileWrappert IOPumpc B s) e Z d Z d „ Z d „ Z d „ Z RS( sŠ Utility to pump data between clients and servers for protocol testing. Perhaps this is a utility worthy of being in protocol.py? c C s( | | _ | | _ | | _ | | _ d S( N( t clientt servert clientIOt serverIO( t selfR R R R ( ( s: /usr/lib/python2.7/dist-packages/twisted/test/testutils.pyt __init__ s c C s x | j ƒ r q Wd S( s, Pump until there is no more input or output.N( t pump( R ( ( s: /usr/lib/python2.7/dist-packages/twisted/test/testutils.pyt flush s c C sÒ | j j d ƒ | j j d ƒ | j j ƒ } | j j ƒ } | j j d ƒ | j j d ƒ | j j ƒ | j j ƒ x | D] } | j j | ƒ q Wx | D] } | j j | ƒ q W| sÆ | rÊ d Sd Sd S( sO Move data back and forth. Returns whether any data was moved. i i N( R t seekR t readt truncateR t dataReceivedR ( R t cDatat sDatat byte( ( s: /usr/lib/python2.7/dist-packages/twisted/test/testutils.pyR s ( t __name__t __module__t __doc__R R R ( ( ( s: /usr/lib/python2.7/dist-packages/twisted/test/testutils.pyR s c C se t ƒ } t ƒ } | j t | ƒ ƒ | j t | ƒ ƒ t | | | | ƒ } | j ƒ | j ƒ | S( s2 Take two Protocol instances and connect them. ( R t makeConnectionR R R ( R R t ciot sioR ( ( s: /usr/lib/python2.7/dist-packages/twisted/test/testutils.pyt returnConnected+ s N( ( t cStringIOR t twisted.internet.protocolR R R ( ( ( s: /usr/lib/python2.7/dist-packages/twisted/test/testutils.pyt <module> s '