def mock_response_500(monkeypatch):
    """Creating of mock_get method from the class, and monkeypatch application.

    It will return a 500 status code, emulating an invalid state of the API error.
    """

    def mock_get(*args, **kwargs):
        raise GenericApiError("Mock error")

    monkeypatch.setattr(users_api, "whoami", mock_get)
Creating of mock_get method from the class, and monkeypatch application.

    It will return a 500 status code, emulating an invalid state of the API error.
    
argilla-v1/tests/integration/client/test_api.py