def test_bothSidesLoseConnection(self):
        class CloseAfterHandshake(protocol.Protocol):
            gotData = False

            def __init__(self):
                self.done = defer.Deferred()

            def connectionMade(self):
                self.transport.write(b"a")

            def dataReceived(self, data):
                # If we got data, handshake is over:
                self.gotData = True
                self.transport.loseConnection()

            def connectionLost(self, reason):
                if not self.gotData:
                    reason = RuntimeError("We never received the data!")
                self.done.errback(reason)
                del self.done

        org = "twisted.test.test_ssl"
        self.setupServerAndClient(
            (org, org + ", client"), {},
            (org, org + ", server"), {})

        serverProtocol = CloseAfterHandshake()
        serverProtocolFactory = protocol.ServerFactory()
        serverProtocolFactory.protocol = lambda: serverProtocol
        serverPort = reactor.listenSSL(0,
            serverProtocolFactory, self.serverCtxFactory)
        self.addCleanup(serverPort.stopListening)

        clientProtocol = CloseAfterHandshake()
        clientProtocolFactory = protocol.ClientFactory()
        clientProtocolFactory.protocol = lambda: clientProtocol
        reactor.connectSSL('127.0.0.1',
            serverPort.getHost().port, clientProtocolFactory, self.clientCtxFactory)

        def checkResult(failure):
            failure.trap(ConnectionDone)
        return defer.gatherResults(
            [clientProtocol.done.addErrback(checkResult),
             serverProtocol.done.addErrback(checkResult)])
Post RPMs to upload URI, this does all the work
dataset/ETHPy150Open twisted/twisted/twisted/test/test_ssl.py/ConnectionLostTests.test_bothSidesLoseConnection--crossover with--dataset/ETHPy150Open FINRAOS/yum-nginx-api/yumapi/__init__.py/upload_file