def test_REQUEST_FAILURE(self):
        """
        Test that global request failure packets cause the Deferred to be
        erred back.
        """
        d = self.conn.sendGlobalRequest(b'request', b'data', True)
        self.conn.ssh_REQUEST_FAILURE(b'data')
        def check(f):
            self.assertEqual(f.value.data, b'data')
        d.addCallback(self.fail)
        d.addErrback(check)
        return d

        Test that global request failure packets cause the Deferred to be
        erred back.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_connection.py