def METHOD_NAME(self):
    # A mock response for an HTTP head request to emulate server down
    response_mock = mock.Mock()
    response_mock.status_code = 500
    response_mock.headers = {}
    response_mock.raise_for_status.side_effect = HTTPError
    response_mock.json.return_value = {}
    # Download this model to make sure it's in the cache.
    _ = ViTImageProcessor.from_pretrained("hf-internal-testing/tiny-random-vit")
    # Under the mock environment we get a 500 error when trying to reach the model.
    with mock.patch("requests.Session.request", return_value=response_mock) as mock_head:
        _ = ViTImageProcessor.from_pretrained("hf-internal-testing/tiny-random-vit")
        # This check we did call the fake head request
        mock_head.assert_called()