code: def test_websocket():
      with client.websocket_connect("/items/portal-gun") as websocket:
          data = websocket.receive_json()
          assert data == {
              "item_id": "portal-gun",
              "path": "/items/{item_id}",
          }
  
file_path: fastapi/tests/test_route_scope.py
imports: import pytest
  from fastapi import FastAPI, Request, WebSocket, WebSocketDisconnect
  from fastapi.routing import APIRoute, APIWebSocketRoute
  from fastapi.testclient import TestClient
label_desc: Use image node_id 4 for calling a global function with example usage: test_websocket() without return types