This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
To maintain parity between exceptions between pyamqp and uamqp add in negative tests to expose behavior/exceptions during a failure.
cases to test:
[x] when creating client with DefaultAzureCredential, pass in fully_qualified_namespace=None.
In pyamqp: gives us 'can only concatenate str (not "NoneType") to str\ncan only concatenate str (not "NoneType") to str'). This is b/c the AMQPClient._hostname = None, so in def _open, creating Connection object with "amqps://" + self._hostname gives us error.
[x] passing None in as sas_policy and key in EventHubSharedKeyCredential
in pyamqp, error:
in uamqp, error:
[x] token auth failure/bad signature:
pyamqp:
azure.eventhub._pyamqp.error.TokenAuthFailure: CBS Token authentication failed.
Status code: 401
Description: InvalidSignature: The token has an invalid signature. TrackingId:14e015a9-f58f-44ec-8030-0faf2ec77923, SystemTracker:NoSystemTracker, Timestamp:2022-05-12T16:19:46
for uamqp error is: Authentication Put-Token failed. Retries exhausted.
[x] for credentials: note that a bad/expired token will be checked during client creation. For pyamqp, it looks like this token failure is not being retried. Need to double check
To maintain parity between exceptions between pyamqp and uamqp add in negative tests to expose behavior/exceptions during a failure.
cases to test:
fully_qualified_namespace=None
.EventHubSharedKeyCredential