make_test_request_handler

Functionin mock_http_serverfastly-compute 0.1.3View source
make_test_request_handler(responses: dict[str, dict[str, Any]]) -> type[BaseHTTPRequestHandler]

Create a request handler class with configured responses.

Parameters

responses: dict[str, dict[str, Any]]

Dictionary mapping paths to response configurations

Returns

type[BaseHTTPRequestHandler]

A new handler class with responses bound as a class attribute