code: def test_composit_endpoint_data(lightning_squeezenet1_1_obj):
      from tests.core.serve.models import (
          ClassificationInferenceComposable,
      )
  
      comp = ClassificationInferenceComposable(
          lightning_squeezenet1_1_obj
      )
      composit = Composition(comp=comp)
      assert composit.component_uid_names == {"callnum_1": "comp"}
      assert composit.connections == []
  
      actual_endpoints = {
          k: asdict(v) for k, v in composit.endpoints.items()
      }
      assert actual_endpoints == {
          "classify_ENDPOINT": {
              "inputs": {
                  "img": "callnum_1.inputs.img",
                  "tag": "callnum_1.inputs.tag",
              },
              "outputs": {
                  "cropped_img": "callnum_1.outputs.cropped_img",
                  "predicted_tag": "callnum_1.outputs.predicted_tag",
              },
              "route": "/classify",
          }
      }
  
      ep = Endpoint(
          route="/predict",
          inputs={
              "label_1": comp.inputs.img,
              "tag_1": comp.inputs.tag,
          },
          outputs={
              "prediction": comp.outputs.predicted_tag,
              "cropped": comp.outputs.cropped_img,
          },
      )
      composit = Composition(comp=comp, predict_ep=ep)
      actual_endpoints = {
          k: asdict(v) for k, v in composit.endpoints.items()
      }
      assert actual_endpoints == {
          "predict_ep": {
              "inputs": {
                  "label_1": "callnum_1.inputs.img",
                  "tag_1": "callnum_1.inputs.tag",
              },
              "outputs": {
                  "cropped": "callnum_1.outputs.cropped_img",
                  "prediction": "callnum_1.outputs.predicted_tag",
              },
              "route": "/predict",
          }
      }
  
file_path: lightning-flash/tests/core/serve/test_composition.py
imports: import base64
  from dataclasses import asdict
  import pytest
  from flash.core.serve import Composition, Endpoint
  from flash.core.utilities.imports import _FASTAPI_AVAILABLE, _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 1 for calling a global function with example usage: test_composit_endpoint_data(lightning_squeezenet1_1_obj) without return types