def test_registerProducer(self):
        """
        Registering a producer with the endpoint transport registers it with
        the underlying process transport.
        """
        @implementer(IPushProducer)
        class AProducer(object):
            pass
        aProducer = AProducer()
        self.endpointTransport.registerProducer(aProducer, False)
        self.assertIs(self.process.producer, aProducer)

        Registering a producer with the endpoint transport registers it with
        the underlying process transport.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_endpoints.py