SameerMesiah97 commented on code in PR #69014:
URL: https://github.com/apache/airflow/pull/69014#discussion_r3483411140
##########
providers/microsoft/azure/tests/unit/microsoft/azure/hooks/test_msgraph.py:
##########
@@ -570,6 +570,19 @@ async def
test_send_request_invalidates_cache_and_raises_on_any_error(self):
adapter.send_no_response_content_async.assert_called_once()
assert hook.conn_id not in hook.cached_request_adapters
+ @pytest.mark.asyncio
+ async def test_allowed_hosts_is_empty_list_when_not_configured(self):
+ """an unset allowed_hosts/authority must yield []."""
+ KiotaRequestAdapterHook.cached_request_adapters.clear()
+ with patch_hook():
+ with patch(
+
"airflow.providers.microsoft.azure.hooks.msgraph.AzureIdentityAuthenticationProvider"
+ ) as mock_auth_provider:
+ hook = KiotaRequestAdapterHook(conn_id="msgraph_api")
+ await hook.get_async_conn()
+
+ assert mock_auth_provider.call_args.kwargs["allowed_hosts"] ==
[]
Review Comment:
Could we make this test exercise the filtering logic? Right now it only
verifies the unconfigured case. Since the implementation now filters out empty
entries, it woud be good to include input like "host1,,host2," (or even just
",") and assert that only the non-empty hosts are passed to
`AzureIdentityAuthenticationProvider`.
--
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]