def test_lostConnection(self):
        """
        A pending query which failed because of a ConnectionLost should
        receive an L{ident.IdentError}.
        """
        d = defer.Deferred()
        self.client.queries.append((d, 765, 432))
        self.client.connectionLost(failure.Failure(error.ConnectionLost()))
        return self.assertFailure(d, ident.IdentError)

        A pending query which failed because of a ConnectionLost should
        receive an L{ident.IdentError}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_ident.py