code: def test_raise_value_error_when_api_name_invalid():
      demo = gr.load(name="spaces/gradio/hello_worldv4-sse")
      with pytest.raises(InvalidApiNameError):
          demo("freddy", api_name="route does not exist")
  
imports: import os
  import tempfile
  import textwrap
  import warnings
  from pathlib import Path
  from unittest.mock import MagicMock, patch
  import pytest
  from fastapi.testclient import TestClient
  from gradio_client import media_data
  from huggingface_hub import HfFolder
  import gradio
  from gradio.context import Context
  from gradio.exceptions import GradioVersionIncompatibleError, InvalidApiNameError
  from gradio.external import TooManyRequestsError, cols_to_rows, get_tabular_examples
label_desc: Use image node_id 7 for calling a global function with example usage: test_raise_value_error_when_api_name_invalid() without return types