def test_stopWriting(self):
        """
        L{Request.stopWriting} calls its body producer's C{stopProducing}
        method.
        """
        producer = StringProducer(3)
        request = Request(b'GET', b'/', _boringHeaders, producer)
        request.writeTo(self.transport)
        self.assertFalse(producer.stopped)
        request.stopWriting()
        self.assertTrue(producer.stopped)

        L{Request.stopWriting} calls its body producer's C{stopProducing}
        method.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_newclient.py