GayathriSrividya commented on code in PR #68499: URL: https://github.com/apache/airflow/pull/68499#discussion_r4053621050
########## airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_router.py: ########## @@ -20,17 +20,76 @@ from unittest.mock import AsyncMock import pytest -from fastapi import FastAPI +import svcs +from fastapi import FastAPI, HTTPException, Request, status +from fastapi.security import HTTPBearer +from fastapi.testclient import TestClient from airflow.api_fastapi.auth.tokens import JWTValidator from airflow.api_fastapi.execution_api.app import lifespan +from airflow.api_fastapi.execution_api.datamodels.token import TIClaims, TIToken +from airflow.api_fastapi.execution_api.security import ( + _REQUEST_SCOPE_TOKEN_KEY, + _jwt_bearer, +) + + [email protected] +def jwt_bearer_client(): + """Test client that exercises JWTBearer so request.scope is populated for the middleware.""" + from starlette.routing import Mount + + from airflow.api_fastapi.app import cached_app Review Comment: moved the inline imports to the module level in the test file as requested. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
