コード例 #1
0
ファイル: test_protocol.py プロジェクト: majestrate/txi2p
 def makeProto(self, *a, **kw):
     protoClass = kw.pop('_protoClass', self.protocol)
     fac = ClientFactory(*a, **kw)
     fac.protocol = protoClass
     def raise_(ex):
         raise ex
     fac.bobConnectionFailed = lambda reason: raise_(reason)
     proto = fac.buildProtocol(None)
     transport = proto_helpers.StringTransport()
     transport.abortConnection = lambda: None
     proto.makeConnection(transport)
     return fac, proto
コード例 #2
0
ファイル: test_protocol.py プロジェクト: LeastAuthority/txi2p
 def makeProto(self, *a, **kw):
     protoClass = kw.pop('_protoClass', self.protocol)
     fac = ClientFactory(*a, **kw)
     fac.protocol = protoClass
     fac.options = {}
     def raise_(ex):
         raise ex
     fac.bobConnectionFailed = lambda reason: raise_(reason)
     proto = fac.buildProtocol(None)
     transport = proto_helpers.StringTransport()
     transport.abortConnection = lambda: None
     proto.makeConnection(transport)
     return fac, proto