code: def test_webgear_routes():
      """
      Test for WebGear API's custom routes
      """
      try:
          # add various performance tweaks as usual
          options = {
              "frame_size_reduction": 40,
              "jpeg_compression_quality": 80,
              "jpeg_compression_fastdct": True,
              "jpeg_compression_fastupsample": False,
              "custom_video_endpoint": "x1y1z",
          }
          # initialize WebGear app
          web = WebGear(
              source=return_testvideo_path(), logging=True, **options
          )
  
          # modify route to point our rendered webpage
          web.routes.append(Route("/hello", endpoint=hello_webpage))
  
          # test
          client = TestClient(web(), raise_server_exceptions=True)
          response = client.get("/")
          assert response.status_code == 200
          response_hello = client.get("/hello")
          assert response_hello.status_code == 200
          # test new default endpoint
          response_xyz = client.get("/x1y1z")
          assert response_xyz.status_code == 200
          # test old default endpoint
          response_video = client.get("/video")
          assert response_video.status_code == 404
          web.shutdown()
      except Exception as e:
          pytest.fail(str(e))
  
imports: import os
  import cv2
  import pytest
  import asyncio
  import logging
  import requests
  import tempfile
  from starlette.routing import Route
  from starlette.responses import JSONResponse
  from starlette.middleware import Middleware
  from starlette.middleware.cors import CORSMiddleware
  from starlette.responses import PlainTextResponse
  from starlette.testclient import TestClient
  from vidgear.gears.asyncio import WebGear
  from vidgear.gears.helper import logger_handler
label_desc: Use image node_id 7 for calling a global function with example usage: test_webgear_routes() without return types