mikamikasuki commented on code in PR #74431:
URL: https://github.com/apache/airflow/pull/74431#discussion_r4219791813
##########
providers/amazon/tests/system/amazon/aws/tests/test_aws_auth_manager.py:
##########
@@ -137,30 +140,42 @@ def base_app(region_name, avp_policy_store_id):
yield mock_init_saml_auth
[email protected]
-def client_no_permissions(base_app):
+def _saml_auth_mock(nameid: str, attributes: dict) -> Mock:
auth = Mock()
auth.is_authenticated.return_value = True
- auth.get_nameid.return_value = "user_no_permissions"
- auth.get_attributes.return_value = {
- "id": ["user_no_permissions"],
- "groups": [],
- "email": ["email"],
- }
- base_app.return_value = auth
+ auth.get_nameid.return_value = nameid
+ auth.get_attributes.return_value = attributes
+ auth.login.return_value =
SAML_METADATA_PARSED["idp"]["singleSignOnService"]["url"]
Review Comment:
MyPy reports “Value of type "object" is not indexable [index]” on this added
access. Could this fixture give `SAML_METADATA_PARSED` a precise nested type
(or cast the IdP metadata before reading the URL) so the providers type check
passes?
---
Drafted-by: Codex (model identifier unavailable in this session) (no human
review before posting)
--
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]