code: def test_path_validation(serve_instance):
      # Path prefix must start with /.
      with pytest.raises(ValueError):
  
          @serve.deployment(route_prefix="hello")
          class D1:
              pass
  
      # Path prefix must not end with / unless it's the root.
      with pytest.raises(ValueError):
  
          @serve.deployment(route_prefix="/hello/")
          class D2:
              pass
  
      # Wildcards not allowed with new ingress support.
      with pytest.raises(ValueError):
  
          @serve.deployment(route_prefix="/{hello}")
          class D3:
              pass
  
      @serve.deployment(route_prefix="/duplicate")
      class D4:
          pass
  
      serve.run(D4.bind())
  
file_path: ray/python/ray/serve/tests/test_http_routes.py
imports: import time
  import pytest
  import requests
  from fastapi import FastAPI, Request
  from starlette.responses import RedirectResponse
  import ray
  from ray import serve
  from ray.serve._private.constants import SERVE_DEFAULT_APP_NAME
label_desc: Use image node_id 1 for calling a global function with example usage: test_path_validation(serve_instance) without return types