Skip to content
Prev Previous commit
Next Next commit
Datalake tests & recordings
  • Loading branch information
vincenttran-msft committed Apr 25, 2024
commit 9eb41715b4b2d66a7c47f1fa4ec011676f34b4f4
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-file-datalake/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-file-datalake",
"Tag": "python/storage/azure-storage-file-datalake_922696d4ec"
"Tag": "python/storage/azure-storage-file-datalake_dec64d97f2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ def test_bad_audience_service_client(self, **kwargs):
audience=f'https://badaudience.blob.core.windows.net/'
)

# Assert
with pytest.raises(ClientAuthenticationError):
dsc.list_file_systems()
dsc.create_file_system('testfs22')
# Will not raise ClientAuthenticationError despite bad audience due to Bearer Challenge
dsc.list_file_systems()
dsc.create_file_system('testfs22')
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ async def test_bad_audience_service_client(self, **kwargs):
audience=f'https://badaudience.blob.core.windows.net/'
)

# Assert
with pytest.raises(ClientAuthenticationError):
dsc.list_file_systems()
await dsc.create_file_system(file_system_name + '1')
# Will not raise ClientAuthenticationError despite bad audience due to Bearer Challenge
dsc.list_file_systems()
await dsc.create_file_system(file_system_name + '1')
Original file line number Diff line number Diff line change
Expand Up @@ -1603,10 +1603,9 @@ def test_bad_audience_dir_client(self, **kwargs):
credential=token_credential, audience=f'https://badaudience.blob.core.windows.net/'
)

# Assert
with pytest.raises(ClientAuthenticationError):
directory_client.exists()
directory_client.create_sub_directory('testsubdir')
# Will not raise ClientAuthenticationError despite bad audience due to Bearer Challenge
directory_client.exists()
directory_client.create_sub_directory('testsubdir')

# ------------------------------------------------------------------------------
if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1553,10 +1553,9 @@ async def test_bad_audience_dir_client(self, **kwargs):
credential=token_credential, audience=f'https://badaudience.blob.core.windows.net/'
)

# Assert
with pytest.raises(ClientAuthenticationError):
await directory_client.exists()
await directory_client.create_sub_directory('testsubdir')
# Will not raise ClientAuthenticationError despite bad audience due to Bearer Challenge
await directory_client.exists()
await directory_client.create_sub_directory('testsubdir')

# ------------------------------------------------------------------------------
if __name__ == '__main__':
Expand Down
7 changes: 3 additions & 4 deletions sdk/storage/azure-storage-file-datalake/tests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -1628,11 +1628,10 @@ def test_bad_audience_file_client(self, **kwargs):
audience=f'https://badaudience.blob.core.windows.net/'
)

# Assert
# Will not raise ClientAuthenticationError despite bad audience due to Bearer Challenge
data = b'Hello world'
with pytest.raises(ClientAuthenticationError):
fc.get_file_properties()
fc.upload_data(data, overwrite=True)
fc.get_file_properties()
fc.upload_data(data, overwrite=True)


# ------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1526,11 +1526,10 @@ async def test_bad_audience_file_client(self, **kwargs):
audience=f'https://badaudience.blob.core.windows.net/'
)

# Assert
# Will not raise ClientAuthenticationError despite bad audience due to Bearer Challenge
data = b'Hello world'
with pytest.raises(ClientAuthenticationError):
await fc.get_file_properties()
await fc.upload_data(data, overwrite=True)
await fc.get_file_properties()
await fc.upload_data(data, overwrite=True)


# ------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1121,10 +1121,9 @@ def test_bad_audience_service_client(self, **kwargs):
audience=f'https://badaudience.blob.core.windows.net/'
)

# Assert
with pytest.raises(ClientAuthenticationError):
fsc.exists()
fsc.create_directory('testdir22')
# Will not raise ClientAuthenticationError despite bad audience due to Bearer Challenge
fsc.exists()
fsc.create_directory('testdir22')

# ------------------------------------------------------------------------------
if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1251,10 +1251,9 @@ async def test_bad_audience_service_client(self, **kwargs):
audience=f'https://badaudience.blob.core.windows.net/'
)

# Assert
with pytest.raises(ClientAuthenticationError):
await fsc.exists()
await fsc.create_directory('testdir22')
# Will not raise ClientAuthenticationError despite bad audience due to Bearer Challenge
await fsc.exists()
await fsc.create_directory('testdir22')

# ------------------------------------------------------------------------------
if __name__ == '__main__':
Expand Down