Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f9703ae
response header verification for start copy async
weirongw23-msft Apr 23, 2024
c237019
reverted back preprod
weirongw23-msft Apr 23, 2024
d7f4229
added tests for upload range to verify copy source error and status c…
weirongw23-msft Apr 24, 2024
a4cf425
work in progress: blob client start copy from url async tests
weirongw23-msft Apr 24, 2024
be0fe5f
copy source error and status code for start copy sync & async
weirongw23-msft Apr 24, 2024
7ed1a03
fixed test case to include copysourceerrormessage prefix
weirongw23-msft Apr 24, 2024
1c45995
surfaced copy source status and error code for upload blob from url (…
weirongw23-msft Apr 25, 2024
49d6d44
surfaced copy source status and error code for stage block from url
weirongw23-msft Apr 25, 2024
8e1c28e
surfaced copy source error and status code for upload pages from url
weirongw23-msft Apr 25, 2024
2495ad2
surfaced copy source error and status code for append block from url
weirongw23-msft Apr 25, 2024
1c1fd42
test recordings for copy source error and status code for blob package
weirongw23-msft Apr 25, 2024
68ab98d
Merge branch 'feature/storage-stg94' into weirongw23/errcode-copy-blob
weirongw23-msft Apr 26, 2024
77ffa00
re-recorded blob tests
weirongw23-msft Apr 26, 2024
74e486a
fixed test recordings by replacing sv dates
weirongw23-msft Apr 26, 2024
c26a42a
added test recordings for authentication error details
weirongw23-msft Apr 26, 2024
e25229f
removed date from se in auth err details tests
weirongw23-msft Apr 26, 2024
2954578
fixed typo for se in auth err details tests
weirongw23-msft Apr 26, 2024
50b7c6e
prototype to test out retry policy for timeout with copy blob error c…
weirongw23-msft Apr 27, 2024
e78005f
included all errors to retry surfaced from copy-source-status-code
weirongw23-msft Apr 27, 2024
24b8087
updated retry policy and tests to retry on specified error codes
weirongw23-msft May 1, 2024
8235de8
updated generate code to include get_account_info
weirongw23-msft May 1, 2024
968e8bf
updated test recordings after code regen, added recording for retry test
weirongw23-msft May 1, 2024
8f3025a
modified se= test recordings for get account info
weirongw23-msft May 1, 2024
78c769d
moved retry logic to all packages, added sync test in blob
weirongw23-msft May 1, 2024
ed4eda9
added sync versions of error code for copy blob tests and recordings
weirongw23-msft May 2, 2024
c87a0d5
removed copysourceerrormessage asserts and updated recordings
weirongw23-msft May 6, 2024
338f2dc
updated response handler logic to account for case senitivity in mess…
weirongw23-msft May 7, 2024
8b68407
fixed authentication error detail message capitalization check in sha…
weirongw23-msft May 7, 2024
adedf47
updated style to lowercasing strings
weirongw23-msft May 7, 2024
27707f6
fixed mypy errors for additional_data and error_dict types
weirongw23-msft May 8, 2024
4c0be2d
fixed pylint errors for too many branches in process storage errors
weirongw23-msft May 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed copysourceerrormessage asserts and updated recordings
  • Loading branch information
weirongw23-msft committed May 6, 2024
commit c87a0d5b65f78872a4475cd800bbd1e85a020b7f
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-blob/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "python",
"TagPrefix": "python/storage/azure-storage-blob",
"Tag": "python/storage/azure-storage-blob_d03ceb7e4b"
"Tag": "python/storage/azure-storage-blob_863b753fbb"
}
1 change: 0 additions & 1 deletion sdk/storage/azure-storage-blob/tests/test_append_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ def test_append_blob_async_copy_source_error_and_status_code(self, **kwargs):
# Assert
assert e.value.response.headers["x-ms-copy-source-status-code"] == "409"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "PublicAccessNotPermitted"
assert "copysourceerrormessage:Public access is not permitted on this storage account." in e.value.message

@BlobPreparer()
@recorded_by_proxy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ async def test_append_blob_async_copy_source_error_and_status_code(self, **kwarg
# Assert
assert e.value.response.headers["x-ms-copy-source-status-code"] == "409"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "PublicAccessNotPermitted"
assert "copysourceerrormessage:Public access is not permitted on this storage account." in e.value.message

@BlobPreparer()
@recorded_by_proxy_async
Expand Down
22 changes: 21 additions & 1 deletion sdk/storage/azure-storage-blob/tests/test_block_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,27 @@ def test_put_block(self, **kwargs):

# Assert

@BlobPreparer()
@recorded_by_proxy
def test_upload_blob_from_url_sync_copy_source_error_and_status_code(self, **kwargs):
storage_account_name = kwargs.pop("storage_account_name")
storage_account_key = kwargs.pop("storage_account_key")

# Arrange
self._setup(storage_account_name, storage_account_key)
source_blob_name = "sourceblob"
source_blob = self.bsc.get_blob_client(self.container_name, source_blob_name)
target_blob_name = "targetblob"
target_blob = self.bsc.get_blob_client(self.container_name, target_blob_name)

# Act
with pytest.raises(HttpResponseError) as e:
target_blob.upload_blob_from_url(source_blob.url)

# Assert
assert e.value.response.headers["x-ms-copy-source-status-code"] == "409"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "PublicAccessNotPermitted"

@BlobPreparer()
@recorded_by_proxy
def test_put_block_with_response(self, **kwargs):
Expand Down Expand Up @@ -649,7 +670,6 @@ def test_stage_block_from_url_copy_source_error_and_status_code(self, **kwargs):
# Assert
assert e.value.response.headers["x-ms-copy-source-status-code"] == "409"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "PublicAccessNotPermitted"
assert "copysourceerrormessage:Public access is not permitted on this storage account." in e.value.message

@BlobPreparer()
@recorded_by_proxy
Expand Down
2 changes: 0 additions & 2 deletions sdk/storage/azure-storage-blob/tests/test_block_blob_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ async def test_upload_blob_from_url_sync_copy_source_error_and_status_code(self,
# Assert
assert e.value.response.headers["x-ms-copy-source-status-code"] == "409"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "PublicAccessNotPermitted"
assert "copysourceerrormessage:Public access is not permitted on this storage account." in e.value.message

@BlobPreparer()
@recorded_by_proxy_async
Expand Down Expand Up @@ -623,7 +622,6 @@ async def test_stage_block_from_url_copy_source_error_and_status_code(self, **kw
# Assert
assert e.value.response.headers["x-ms-copy-source-status-code"] == "409"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "PublicAccessNotPermitted"
assert "copysourceerrormessage:Public access is not permitted on this storage account." in e.value.message

@BlobPreparer()
@recorded_by_proxy_async
Expand Down
2 changes: 0 additions & 2 deletions sdk/storage/azure-storage-blob/tests/test_common_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,6 @@ def test_copy_blob_async_copy_source_error_and_status_code(self, **kwargs):
# Assert
assert e.value.response.headers["x-ms-copy-source-error-code"] == "BlobNotFound"
assert e.value.response.headers["x-ms-copy-source-status-code"] == "404"
assert "copysourceerrormessage:The specified blob does not exist." in e.value.message

@BlobPreparer()
@recorded_by_proxy
Expand All @@ -1746,7 +1745,6 @@ def test_copy_blob_copy_source_error_and_status_code(self, **kwargs):
# Assert
assert e.value.response.headers["x-ms-copy-source-status-code"] == "409"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "PublicAccessNotPermitted"
assert "copysourceerrormessage:Public access is not permitted on this storage account." in e.value.message

@BlobPreparer()
@recorded_by_proxy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,6 @@ async def test_copy_blob_async_copy_source_error_and_status_code(self, **kwargs)
# Assert
assert e.value.response.headers["x-ms-copy-source-error-code"] == "BlobNotFound"
assert e.value.response.headers["x-ms-copy-source-status-code"] == "404"
assert "copysourceerrormessage:The specified blob does not exist." in e.value.message

@BlobPreparer()
@recorded_by_proxy_async
Expand All @@ -1960,7 +1959,6 @@ async def test_copy_blob_copy_source_error_and_status_code(self, **kwargs):
# Assert
assert e.value.response.headers["x-ms-copy-source-status-code"] == "409"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "PublicAccessNotPermitted"
assert "copysourceerrormessage:Public access is not permitted on this storage account." in e.value.message

@BlobPreparer()
@recorded_by_proxy_async
Expand Down
1 change: 0 additions & 1 deletion sdk/storage/azure-storage-blob/tests/test_page_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,6 @@ def test_upload_pages_from_url_copy_source_error_and_status_code(self, **kwargs)
# Assert
assert e.value.response.headers["x-ms-copy-source-status-code"] == "409"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "PublicAccessNotPermitted"
assert "copysourceerrormessage:Public access is not permitted on this storage account." in e.value.message

@BlobPreparer()
@recorded_by_proxy
Expand Down
2 changes: 0 additions & 2 deletions sdk/storage/azure-storage-blob/tests/test_page_blob_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,6 @@ async def test_upload_pages_from_url_copy_source_error_and_status_code(self, **k
# Assert
assert e.value.response.headers["x-ms-copy-source-status-code"] == "409"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "PublicAccessNotPermitted"
assert "copysourceerrormessage:Public access is not permitted on this storage account." in e.value.message


@BlobPreparer()
@recorded_by_proxy_async
Expand Down
4 changes: 0 additions & 4 deletions sdk/storage/azure-storage-file-share/tests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -1587,8 +1587,6 @@ def test_update_range_from_file_url_copy_source_error_and_status_code(self, **kw

assert e.value.response.headers["x-ms-copy-source-status-code"] == "401"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "NoAuthenticationInformation"
assert ("copysourceerrormessage:Server failed to authenticate the request. Please refer to the information in "
"the www-authenticate header.") in e.value.message

@FileSharePreparer()
@recorded_by_proxy
Expand Down Expand Up @@ -2629,8 +2627,6 @@ def test_copy_file_async_copy_source_error_and_status_code(self, **kwargs):
# Assert
assert e.value.response.headers["x-ms-copy-source-status-code"] == "400"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "InvalidQueryParameterValue"
assert ("copysourceerrormessage:Value for one of the query parameters specified in the "
"request URI is invalid.") in e.value.message

@FileSharePreparer()
@recorded_by_proxy
Expand Down
4 changes: 0 additions & 4 deletions sdk/storage/azure-storage-file-share/tests/test_file_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -1624,8 +1624,6 @@ async def test_update_range_from_file_url_copy_source_error_and_status_code(self

assert e.value.response.headers["x-ms-copy-source-status-code"] == "401"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "NoAuthenticationInformation"
assert ("copysourceerrormessage:Server failed to authenticate the request. Please refer to the information in "
"the www-authenticate header.") in e.value.message

@FileSharePreparer()
@recorded_by_proxy_async
Expand Down Expand Up @@ -2688,8 +2686,6 @@ async def test_copy_file_async_copy_source_error_and_status_code(self, **kwargs)
# Assert
assert e.value.response.headers["x-ms-copy-source-status-code"] == "400"
assert e.value.response.headers["x-ms-copy-source-error-code"] == "InvalidQueryParameterValue"
assert ("copysourceerrormessage:Value for one of the query parameters specified in the "
"request URI is invalid.") in e.value.message

@FileSharePreparer()
@recorded_by_proxy_async
Expand Down