code: def test_offline_with_connection_error():
      with offline(OfflineSimulationMode.CONNECTION_FAILS):
          with pytest.raises(requests.exceptions.ConnectionError):
              requests.request("GET", "https://huggingface.co")
          with pytest.raises(requests.exceptions.ConnectionError):
              http_get("https://huggingface.co", BytesIO())
  
file_path: huggingface_hub/tests/test_offline_utils.py
imports: from io import BytesIO
  import pytest
  import requests
  from huggingface_hub.file_download import http_get
  from .testing_utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline
label_desc: Use image node_id 2 for calling a global function with example usage: test_offline_with_connection_error() without return types