code: def test_invalid_expose_inputs():
      from flash.core.serve import ModelComponent, expose
      from flash.core.serve.types import Number
  
      lr = LightningSqueezenet()
  
      with pytest.raises(
          SyntaxError, match="must be valid python attribute"
      ):
  
          class ComposeClassInvalidExposeNameKeyword(ModelComponent):
              def __init__(self, model):
                  pass
  
              @expose(
                  inputs={"param": Number()}, outputs={"def": Number()}
              )
              @staticmethod
              def predict(param):
                  return param
  
          _ = ComposeClassInvalidExposeNameKeyword(lr)
  
      with pytest.raises(
          AttributeError, match="object has no attribute"
      ):
  
          class ComposeClassInvalidExposeNameType(ModelComponent):
              def __init__(self, model):
                  pass
  
              @expose(
                  inputs={"param": Number()}, outputs={12: Number()}
              )
              @staticmethod
              def predict(param):
                  return param
  
          _ = ComposeClassInvalidExposeNameType(lr)
  
      with pytest.raises(TypeError, match="`expose` values must be"):
  
          class ComposeClassInvalidExposeInputsType(ModelComponent):
              def __init__(self, model):
                  pass
  
              @expose(inputs=Number(), outputs={"foo": Number()})
              @staticmethod
              def predict(param):
                  return param
  
          _ = ComposeClassInvalidExposeInputsType(lr)
  
      with pytest.raises(
          ValueError, match="cannot set dict of length < 1"
      ):
  
          class ComposeClassEmptyExposeInputsType(ModelComponent):
              def __init__(self, model):
                  pass
  
              @expose(inputs={}, outputs={"foo": Number()})
              @staticmethod
              def predict(param):
                  return param
  
          _ = ComposeClassEmptyExposeInputsType(lr)
  
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 7 for calling a global function with example usage: test_invalid_expose_inputs() and returns: param, param, param, param