def test_losingConnection(self):
        """
        Calling L{http.Request.loseConnection} causes the transport to be
        disconnected.
        """
        b = StringTransport()
        a = http.HTTPChannel()
        a.requestFactory = _makeRequestProxyFactory(self.ShutdownHTTPHandler)
        a.makeConnection(b)
        a.dataReceived(self.request)

        # The transport should have been shut down.
        self.assertTrue(b.disconnecting)

        # No response should have been written.
        value = b.value()
        self.assertEqual(value, b'')

        Calling L{http.Request.loseConnection} causes the transport to be
        disconnected.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http.py