From 0078a65bd8b719fa29eeb4aef5478f8f9928e41b Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Wed, 20 Apr 2022 16:55:54 -0700 Subject: [PATCH] Fixed error code checks for live tests (#17676) The returned error codes are authentication errors, not table errors. --- sdk/data/aztables/CHANGELOG.md | 3 +++ sdk/data/aztables/shared_access_signature_test.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sdk/data/aztables/CHANGELOG.md b/sdk/data/aztables/CHANGELOG.md index 88070f1ec2dc..618c17db5904 100644 --- a/sdk/data/aztables/CHANGELOG.md +++ b/sdk/data/aztables/CHANGELOG.md @@ -16,6 +16,9 @@ * Convert `Start` and `Expiry` times in `AccessPolicy` to UTC format as required by the service. * Fixed `moduleName` to report the module name as part of telemetry. +### Other Changes +* Fixed bugs in some live tests. + ## 0.7.0 (2022-04-05) ### Features Added diff --git a/sdk/data/aztables/shared_access_signature_test.go b/sdk/data/aztables/shared_access_signature_test.go index cce8df97e051..3857b8985c70 100644 --- a/sdk/data/aztables/shared_access_signature_test.go +++ b/sdk/data/aztables/shared_access_signature_test.go @@ -175,7 +175,7 @@ func TestSASClientReadOnly(t *testing.T) { require.Error(t, err) var httpErr *azcore.ResponseError require.ErrorAs(t, err, &httpErr) - require.Contains(t, PossibleTableErrorCodeValues(), TableErrorCode(httpErr.ErrorCode)) + require.Equal(t, "AuthorizationPermissionMismatch", httpErr.ErrorCode) // Success on a list pager := client.NewListEntitiesPager(nil) @@ -244,7 +244,7 @@ func TestSASCosmosClientReadOnly(t *testing.T) { require.Error(t, err) var httpErr *azcore.ResponseError require.ErrorAs(t, err, &httpErr) - require.Contains(t, PossibleTableErrorCodeValues(), TableErrorCode(httpErr.ErrorCode)) + require.Equal(t, "Forbidden", httpErr.ErrorCode) // Success on a list pager := client.NewListEntitiesPager(nil)