def test_writeAfterFinish(self):
        """
        Calling L{Request.write} after L{Request.finish} has been called results
        in a L{RuntimeError} being raised.
        """
        request = http.Request(DummyChannel(), False)
        finished = request.notifyFinish()
        # Force the request to have a non-None content attribute.  This is
        # probably a bug in Request.
        request.gotLength(1)
        request.write(b'foobar')
        request.finish()
        self.assertRaises(RuntimeError, request.write, b'foobar')
        return finished

        Calling L{Request.write} after L{Request.finish} has been called results
        in a L{RuntimeError} being raised.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http.py