diff --git a/tests/integration/test_openapi_json.py b/tests/integration/test_openapi_json.py index 3fa83fb2..a102ccff 100644 --- a/tests/integration/test_openapi_json.py +++ b/tests/integration/test_openapi_json.py @@ -85,8 +85,19 @@ def _check_server_section_present(spec: dict[str, Any]) -> None: def _check_paths_and_responses_exist( - spec: dict, path: str, method: str, expected_codes: set[str] + spec: dict[str, Any], path: str, method: str, expected_codes: set[str] ) -> None: + """Checks if the specified paths and responses exist in the API specification. + + Args: + spec (dict): The API specification. + path (str): The API endpoint path to check. + method (str): The HTTP method to check. + expected_codes (set[str]): The set of expected HTTP status codes. + + Raises: + AssertionError: If the path, method, or any of the expected response codes are missing. + """ paths = spec.get("paths") or {} assert path in paths, f"Missing path: {path}" op = (paths[path] or {}).get(method)