code: def test_encode_url_to_base64_doesnt_encode_errors(monkeypatch):
      request = httpx.Request("GET", "https://example.com/foo")
      error_response = httpx.Response(status_code=404, request=request)
      monkeypatch.setattr(
          httpx, "get", lambda *args, **kwargs: error_response
      )
      with pytest.raises(httpx.HTTPStatusError):
          utils.encode_url_to_base64("https://example.com/foo")
  
imports: import importlib.resources
  import json
  import os
  import tempfile
  from copy import deepcopy
  from pathlib import Path
  from unittest.mock import MagicMock, patch
  import httpx
  import pytest
  from huggingface_hub import HfFolder
  from gradio_client import media_data, utils
label_desc: Use image node_id 4 for calling a global function with example usage: test_encode_url_to_base64_doesnt_encode_errors(monkeypatch) without return types