code: def test_input_validation():
      name = "test"
  
      @serve.deployment(name=name)
      class Base:
          pass
  
      with pytest.raises(RuntimeError):
          Base()
  
      with pytest.raises(TypeError):
  
          @serve.deployment(name=name, version=1)
          class BadVersion:
              pass
  
      with pytest.raises(TypeError):
          Base.options(version=1)
  
      with pytest.raises(ValidationError):
  
          @serve.deployment(num_replicas="hi")
          class BadNumReplicas:
              pass
  
      with pytest.raises(ValidationError):
          Base.options(num_replicas="hi")
  
      with pytest.raises(ValueError):
  
          @serve.deployment(num_replicas=0)
          class ZeroNumReplicas:
              pass
  
      with pytest.raises(ValueError):
          Base.options(num_replicas=0)
  
      with pytest.raises(ValidationError):
  
          @serve.deployment(num_replicas=-1)
          class NegativeNumReplicas:
              pass
  
      with pytest.raises(ValidationError):
          Base.options(num_replicas=-1)
  
      with pytest.raises(TypeError):
  
          @serve.deployment(ray_actor_options=[1, 2, 3])
          class BadActorOpts:
              pass
  
      with pytest.raises(TypeError):
          Base.options(ray_actor_options="hi")
  
      with pytest.raises(ValidationError):
  
          @serve.deployment(max_concurrent_queries="hi")
          class BadMaxQueries:
              pass
  
      with pytest.raises(ValidationError):
          Base.options(max_concurrent_queries=[1])
  
      with pytest.raises(ValueError):
  
          @serve.deployment(max_concurrent_queries=0)
          class ZeroMaxQueries:
              pass
  
      with pytest.raises(ValueError):
          Base.options(max_concurrent_queries=0)
  
      with pytest.raises(ValueError):
  
          @serve.deployment(max_concurrent_queries=-1)
          class NegativeMaxQueries:
              pass
  
      with pytest.raises(ValueError):
          Base.options(max_concurrent_queries=-1)
  
imports: import os
  import sys
  import time
  from collections import defaultdict
  from typing import Callable
  import pytest
  import requests
  import ray
  from ray import serve
  from ray._private.pydantic_compat import ValidationError
  from ray._private.test_utils import SignalActor
  from ray.serve._private.utils import get_random_string
  from ray.serve.exceptions import RayServeException
label_desc: Use image node_id 14 for calling a global function with example usage: test_input_validation() without return types