Skip to content

Commit

Permalink
[devtool]turn primary_endpoint and key from unicode into str
Browse files Browse the repository at this point in the history
  • Loading branch information
xiafu-msft committed Sep 4, 2020
1 parent 6004ea4 commit d7300c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@
class StorageBlockBlobTest(StorageTestCase):

def _setup(self, storage_account, key):
account_url = self.account_url(storage_account, "blob")
if isinstance(account_url, unicode):
account_url = account_url.encode('utf-8')
key = key.encode('utf-8')
self.bsc = BlobServiceClient(
self.account_url(storage_account, "blob"),
account_url,
credential=key,
connection_data_block_size=4 * 1024,
max_single_put_size=32 * 1024,
Expand Down
6 changes: 5 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 @@ -410,7 +410,11 @@ def test_update_page_unicode(self, resource_group, location, storage_account, st
@GlobalStorageAccountPreparer()
def test_upload_pages_from_url(self, resource_group, location, storage_account, storage_account_key):
# Arrange
bsc = BlobServiceClient(self.account_url(storage_account, "blob"), credential=storage_account_key, connection_data_block_size=4 * 1024, max_page_size=4 * 1024)
account_url = self.account_url(storage_account, "blob")
if isinstance(account_url, unicode):
account_url = account_url.encode('utf-8')
storage_account_key = storage_account_key.encode('utf-8')
bsc = BlobServiceClient(account_url, credential=storage_account_key, connection_data_block_size=4 * 1024, max_page_size=4 * 1024)
self._setup(bsc)
source_blob_data = self.get_random_bytes(SOURCE_BLOB_SIZE)
source_blob_client = self._create_source_blob(bsc, source_blob_data, 0, SOURCE_BLOB_SIZE)
Expand Down

0 comments on commit d7300c9

Please sign in to comment.