uranusjr commented on code in PR #68490:
URL: https://github.com/apache/airflow/pull/68490#discussion_r3407748119
##########
providers/microsoft/azure/tests/unit/microsoft/azure/hooks/test_wasb.py:
##########
@@ -361,10 +371,14 @@ def test_sas_token_connection(self, conn_id_str,
extra_key):
hook_conn = hook.get_connection(hook.conn_id)
sas_token = hook_conn.extra_dejson[extra_key]
assert isinstance(conn, BlobServiceClient)
- assert conn.url.startswith("https://")
- if hook_conn.login:
- assert hook_conn.login in conn.url
- assert conn.url.endswith(sas_token + "/")
+ if sas_token.startswith("https"):
+ # HTTPS SAS URL: the full URL is passed to BlobServiceClient as-is;
+ # credential handling is left to the SDK.
+ assert conn.url.startswith("https://")
+ else:
+ # Plain SAS token: the hook wraps it in AzureSasCredential.
+ assert isinstance(conn.credential, AzureSasCredential)
+ assert conn.credential.signature == sas_token
Review Comment:
I know they are handled separately, but are both branches covered in tests?
--
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]