code: def test_create_invalid_endpoint(lightning_squeezenet1_1_obj):
      from flash.core.serve import Endpoint
  
      comp1 = ClassificationInferenceComposable(
          lightning_squeezenet1_1_obj
      )
  
      with pytest.raises(
          TypeError, match="route parameter must be type"
      ):
          _ = Endpoint(
              route=b"/INVALID",
              inputs={"inp": comp1.inputs.img},
              outputs={"out": comp1.outputs.cropped_img},
          )
  
      with pytest.raises(ValueError, match="route must begin with"):
          _ = Endpoint(
              route="hello",
              inputs={"inp": comp1.inputs.img},
              outputs={"out": comp1.outputs.cropped_img},
          )
  
      with pytest.raises(TypeError, match="inputs k=inp, v=b'INVALID'"):
          _ = Endpoint(
              route="/hello",
              inputs={"inp": b"INVALID"},
              outputs={"out": comp1.outputs.cropped_img},
          )
  
      with pytest.raises(TypeError, match="k=out, v=b'INVALID'"):
          _ = Endpoint(
              route="/hello",
              inputs={"inp": comp1.inputs.img},
              outputs={"out": b"INVALID"},
          )
  
file_path: lightning-flash/tests/core/serve/test_components.py
imports: import pytest
  import torch
  from flash.core.serve.types import Label
  from flash.core.utilities.imports import _TOPIC_SERVE_AVAILABLE
  from tests.core.serve.models import ClassificationInferenceComposable, LightningSqueezenet
label_desc: Use image node_id 12 for calling a global function with example usage: test_create_invalid_endpoint(lightning_squeezenet1_1_obj) without return types