def test_streamingProducerResumedInWriteBlockedOnReadMode(self):
        clientProtocol, tlsProtocol, producer = self.setupStreamingProducer()

        # Write to TLS transport, triggering WantReadError; this should cause
        # the producer to be paused. We use a large chunk of data to make sure
        # large writes don't trigger multiple pauses:
        clientProtocol.transport.write("hello world" * 320000)
        self.assertEqual(producer.producerHistory, ['pause'])

        # Now deliver bytes that will fix the WantRead condition; this should
        # unpause the producer:
        serverProtocol, serverTLSProtocol = buildTLSProtocol(server=True)
        self.flushTwoTLSProtocols(tlsProtocol, serverTLSProtocol)
        self.assertEqual(producer.producerHistory, ['pause', 'resume'])
        self.assertEqual(tlsProtocol._producer._producerPaused, False)

        # Make sure we haven't disconnected for some reason:
        self.assertEqual(tlsProtocol.transport.disconnecting, False)
        self.assertEqual(producer.producerState, 'producing')
When the TLS transport is blocked on reads, it correctly calls
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/protocols/test/test_tls.py/TLSProducerTests.test_streamingProducerResumedInWriteBlockedOnReadMode