def oneTransportTest(testMethod):
 @wraps(testMethod)
 def actualTestMethod(builder):
  other = ConnectableProtocol()
  class ServerProtocol(ConnectableProtocol, ):
   def connectionMade(self):
    try:
     testMethod(builder, self.reactor, self.transport)
    finally:
     if (self.transport is not None):
      self.transport.loseConnection()
     if (other.transport is not None):
      other.transport.loseConnection()
  serverProtocol = ServerProtocol()
  runProtocolsWithReactor(builder, serverProtocol, other, TCPCreator())
 return actualTestMethod

def oneTransportTest ( testMethod ) : @ wraps ( testMethod ) def actualTestMethod ( builder ) : other = ConnectableProtocol ( ) class ServerProtocol ( ConnectableProtocol , ) : def connectionMade ( self ) : try : testMethod ( builder , self . reactor , self . transport ) finally : if ( self . transport is not None ) : self . transport . loseConnection ( ) if ( other . transport is not None ) : other . transport . loseConnection ( ) serverProtocol = ServerProtocol ( ) runProtocolsWithReactor ( builder , serverProtocol , other , TCPCreator ( ) ) return actualTestMethod
decorate a l{reactorbuilder} test function which tests one reactor and one connected transport .