pierrejeambrun commented on code in PR #70783:
URL: https://github.com/apache/airflow/pull/70783#discussion_r4015725340
##########
airflow-core/tests/unit/api_fastapi/auth/middlewares/test_refresh_token.py:
##########
@@ -118,10 +122,10 @@ async def test_dispatch_with_refreshed_user(
mock_get_auth_manager.return_value = mock_auth_manager
mock_auth_manager.refresh_user.return_value = refreshed_user
mock_auth_manager.generate_jwt.return_value = "new_token"
- mock_conf.get.return_value = ""
call_next = AsyncMock(return_value=Response())
- response = await middleware.dispatch(mock_request, call_next)
+ with conf_vars({("api", "base_url"): ""}):
Review Comment:
conf_vars({("api", "base_url"): ""}) at lines 127, 207, 235 is a no-op for
what these tests exercise. request_cookie_is_secure reads ("api", "ssl_cert"),
and API_BASE_URL in api_fastapi/app.py:49 is captured at import time so a
runtime conf_vars can't shift get_cookie_path() either. Tests pass because
ssl_cert defaults to "" anyway — but this looks like a leftover from the
removed mock_conf.get.return_value = "" wildcard mock. Either target the right
key or drop the block.
--
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]