Skip to content

Commit 5bd26d9

Browse files
[Azure blob] fix test_private_bucket for azure blob (#3791)
* update tests * lint
1 parent a378a08 commit 5bd26d9

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

sky/adaptors/azure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def get_client(name: str,
186186
if 'ERROR: AADSTS50020' in str(e):
187187
with ux_utils.print_exception_no_traceback():
188188
raise sky_exceptions.StorageBucketGetError(
189-
'Attempted to fetch a non-existant public '
189+
'Attempted to fetch a non-existent public '
190190
'container name: '
191191
f'{container_client.container_name}. '
192192
'Please check if the name is correct.')

sky/data/storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2537,7 +2537,7 @@ def _get_bucket(self) -> Tuple[str, bool]:
25372537
if 'Name or service not known' in error_message:
25382538
with ux_utils.print_exception_no_traceback():
25392539
raise exceptions.StorageBucketGetError(
2540-
'Attempted to fetch the container from non-existant '
2540+
'Attempted to fetch the container from non-existent '
25412541
'storage account '
25422542
f'name: {self.storage_account_name}. Please check '
25432543
'if the name is correct.')

tests/test_smoke.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4895,10 +4895,14 @@ def test_private_bucket(self, private_bucket):
48954895
private_bucket).path.strip('/')
48964896
else:
48974897
private_bucket_name = urllib.parse.urlsplit(private_bucket).netloc
4898-
with pytest.raises(
4899-
sky.exceptions.StorageBucketGetError,
4900-
match=storage_lib._BUCKET_FAIL_TO_CONNECT_MESSAGE.format(
4901-
name=private_bucket_name)):
4898+
match_str = storage_lib._BUCKET_FAIL_TO_CONNECT_MESSAGE.format(
4899+
name=private_bucket_name)
4900+
if store_type == 'https':
4901+
# Azure blob uses a different error string since container may
4902+
# not exist even though the bucket name is ok.
4903+
match_str = 'Attempted to fetch a non-existent public container'
4904+
with pytest.raises(sky.exceptions.StorageBucketGetError,
4905+
match=match_str):
49024906
storage_obj = storage_lib.Storage(source=private_bucket)
49034907

49044908
@pytest.mark.no_fluidstack

0 commit comments

Comments
 (0)