aminghadersohi commented on code in PR #39604:
URL: https://github.com/apache/superset/pull/39604#discussion_r3237086757


##########
tests/unit_tests/mcp_service/test_auth_api_key.py:
##########
@@ -158,89 +195,154 @@ def test_g_user_fallback_when_no_jwt_or_api_key(app, 
mock_user) -> None:
     assert result.username == "api_key_user"
 
 
-# -- FAB version without extract_api_key_from_request --
+# -- FAB version without validate_api_key --
 
 
 @pytest.mark.usefixtures("_enable_api_keys")
-def test_fab_without_extract_method_skips_gracefully(app) -> None:
-    """If FAB SecurityManager lacks extract_api_key_from_request,
-    API key auth should be skipped with a debug log, not crash."""
+def test_fab_without_validate_method_raises(app: SupersetApp) -> None:
+    """If FAB SecurityManager lacks validate_api_key, should raise
+    PermissionError about unavailable validation."""
     mock_sm = MagicMock(spec=[])  # empty spec = no attributes
 
-    with app.test_request_context():
+    with app.app_context():
         g.user = None
         app.appbuilder = MagicMock()
         app.appbuilder.sm = mock_sm

Review Comment:
   Addressed. — agor claude on Amin's behalf



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to