Skip to content

Commit 66ca3bb

Browse files
committed
[devtool]turn primary_endpoint and key from unicode into str
1 parent 6004ea4 commit 66ca3bb

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

sdk/storage/azure-storage-blob/tests/test_block_blob_sync_copy.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@
3131
class StorageBlockBlobTest(StorageTestCase):
3232

3333
def _setup(self, storage_account, key):
34+
account_url = self.account_url(storage_account, "blob")
35+
if not isinstance(account_url, str):
36+
account_url = account_url.encode('utf-8')
37+
key = key.encode('utf-8')
3438
self.bsc = BlobServiceClient(
35-
self.account_url(storage_account, "blob"),
39+
account_url,
3640
credential=key,
3741
connection_data_block_size=4 * 1024,
3842
max_single_put_size=32 * 1024,

sdk/storage/azure-storage-blob/tests/test_page_blob.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,11 @@ def test_update_page_unicode(self, resource_group, location, storage_account, st
410410
@GlobalStorageAccountPreparer()
411411
def test_upload_pages_from_url(self, resource_group, location, storage_account, storage_account_key):
412412
# Arrange
413-
bsc = BlobServiceClient(self.account_url(storage_account, "blob"), credential=storage_account_key, connection_data_block_size=4 * 1024, max_page_size=4 * 1024)
413+
account_url = self.account_url(storage_account, "blob")
414+
if not isinstance(account_url, str):
415+
account_url = account_url.encode('utf-8')
416+
storage_account_key = storage_account_key.encode('utf-8')
417+
bsc = BlobServiceClient(account_url, credential=storage_account_key, connection_data_block_size=4 * 1024, max_page_size=4 * 1024)
414418
self._setup(bsc)
415419
source_blob_data = self.get_random_bytes(SOURCE_BLOB_SIZE)
416420
source_blob_client = self._create_source_blob(bsc, source_blob_data, 0, SOURCE_BLOB_SIZE)

0 commit comments

Comments
 (0)