Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
tests fix for container url
  • Loading branch information
rakshith91 committed Oct 3, 2019
commit 5b32624ae6f4ae1cca9db8665bd68c782853dc8a
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_container_sample(self):
from azure.storage.blob import ContainerClient

sas_url = sas_url = "https://account.blob.core.windows.net/mycontainer?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"
container = ContainerClient(sas_url)
container = ContainerClient.from_container_url(sas_url)
# [END create_container_client_sasurl]

try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async def _test_container_sample_async(self):
from azure.storage.blob.aio import ContainerClient

sas_url = sas_url = "https://account.blob.core.windows.net/mycontainer?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"
container = ContainerClient(sas_url)
container = ContainerClient.from_container_url(sas_url)
# [END create_container_client_sasurl]

try:
Expand Down Expand Up @@ -191,7 +191,7 @@ async def _test_container_access_policy_async(self):
# Use the sas token to authenticate a new client
# [START create_container_client_sastoken]
from azure.storage.blob.aio import ContainerClient
container = ContainerClient(
container = ContainerClient.from_container_url(
container_url="https://account.blob.core.windows.net/mycontainerasync",
credential=sas_token,
)
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-blob/tests/test_common_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,7 @@ def test_get_account_information_with_container_sas(self):
permission=ContainerPermissions.READ,
expiry=datetime.utcnow() + timedelta(hours=1),
)
sas_container = ContainerClient(container.url, credential=token)
sas_container = ContainerClient.from_container_url(container.url, credential=token)

# Act
info = sas_container.get_account_information()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,7 @@ async def _test_get_account_information_with_container_sas(self):
permission=ContainerPermissions.READ,
expiry=datetime.utcnow() + timedelta(hours=1),
)
sas_container = ContainerClient(container.url, credential=token)
sas_container = ContainerClient.from_container_url(container.url, credential=token)

# Act
info = await sas_container.get_account_information()
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-blob/tests/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_sas_signature_is_scrubbed_off(self):
token_components = parse_qs(token)
signed_signature = quote(token_components[QueryStringConstants.SIGNED_SIGNATURE][0])

sas_service = ContainerClient(container.url, credential=token)
sas_service = ContainerClient.from_container_url(container.url, credential=token)

# Act
with LogCaptured(self) as log_captured:
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-blob/tests/test_logging_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async def _test_sas_signature_is_scrubbed_off(self):
token_components = parse_qs(token)
signed_signature = quote(token_components[QueryStringConstants.SIGNED_SIGNATURE][0])

sas_service = ContainerClient(container.url, credential=token)
sas_service = ContainerClient.from_container_url(container.url, credential=token)

# Act
with LogCaptured(self) as log_captured:
Expand Down