File tree Expand file tree Collapse file tree
dev-tools/mcp-mock-server
tests/e2e/mock_mcp_server Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414import time
1515import urllib .request
1616import urllib .error
17- from typing import Any
17+ from typing import Any , Optional
1818
1919import pytest
2020
@@ -76,8 +76,8 @@ def mock_server() -> Any:
7676def make_request (
7777 url : str ,
7878 method : str = "GET" ,
79- data : dict [str , Any ] | None = None ,
80- headers : dict [str , str ] | None = None ,
79+ data : Optional [ dict [str , Any ]] = None ,
80+ headers : Optional [ dict [str , str ]] = None ,
8181 use_https : bool = False ,
8282) -> tuple [int , dict [str , Any ] | str ]:
8383 """Make HTTP request and return status code and response."""
Original file line number Diff line number Diff line change 88
99import json
1010from http .server import HTTPServer , BaseHTTPRequestHandler
11- from typing import Any
11+ from typing import Any , Optional
1212
1313# Standard OAuth-style challenge so the client can drive an OAuth flow
1414WWW_AUTHENTICATE = 'Bearer realm="mock-mcp", error="invalid_token"'
@@ -27,7 +27,7 @@ def _require_oauth(self) -> None:
2727 self .end_headers ()
2828 self .wfile .write (body )
2929
30- def _parse_auth (self ) -> str | None :
30+ def _parse_auth (self ) -> Optional [ str ] :
3131 """Return Bearer token if present, else None."""
3232 auth = self .headers .get ("Authorization" )
3333 if auth and auth .startswith ("Bearer " ) and "invalid" not in auth :
You can’t perform that action at this time.
0 commit comments