Skip to content

Commit 88ff693

Browse files
[Storage] Update test_blob_tags tests + link to GitHub issue for failing tests (Azure#23694)
1 parent a1d223a commit 88ff693

File tree

2 files changed

+4
-189
lines changed

2 files changed

+4
-189
lines changed

sdk/storage/azure-storage-blob/tests/recordings/test_blob_tags.test_set_blob_tags_for_a_version.yaml

Lines changed: 0 additions & 173 deletions
This file was deleted.

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

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
class StorageBlobTagsTest(StorageTestCase):
3737

3838
def _setup(self, storage_account_name, key):
39-
self.bsc = self.create_storage_client(BlobServiceClient, self.account_url(storage_account_name, "blob"), credential=key)
39+
self.bsc = BlobServiceClient(self.account_url(storage_account_name, "blob"), credential=key)
4040
self.container_name = self.get_resource_name("container")
4141
if self.is_live:
4242
container = self.bsc.get_container_client(self.container_name)
@@ -92,7 +92,6 @@ def _create_container(self, prefix="container"):
9292

9393
#-- test cases for blob tags ----------------------------------------------
9494

95-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
9695
@BlobPreparer()
9796
def test_set_blob_tags(self, storage_account_name, storage_account_key):
9897
self._setup(storage_account_name, storage_account_key)
@@ -105,7 +104,6 @@ def test_set_blob_tags(self, storage_account_name, storage_account_key):
105104
# Assert
106105
self.assertIsNotNone(resp)
107106

108-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
109107
@BlobPreparer()
110108
def test_set_blob_tags_with_lease(self, storage_account_name, storage_account_key):
111109
self._setup(storage_account_name, storage_account_key)
@@ -128,7 +126,7 @@ def test_set_blob_tags_with_lease(self, storage_account_name, storage_account_ke
128126

129127
blob_client.delete_blob(lease=lease)
130128

131-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
129+
@pytest.mark.live_test_only
132130
@BlobPreparer()
133131
def test_set_blob_tags_for_a_version(self, versioned_storage_account_name, versioned_storage_account_key):
134132
self._setup(versioned_storage_account_name, versioned_storage_account_key)
@@ -144,7 +142,6 @@ def test_set_blob_tags_for_a_version(self, versioned_storage_account_name, versi
144142
# Assert
145143
self.assertIsNotNone(resp)
146144

147-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
148145
@BlobPreparer()
149146
def test_get_blob_tags(self, storage_account_name, storage_account_key):
150147
self._setup(storage_account_name, storage_account_key)
@@ -162,7 +159,6 @@ def test_get_blob_tags(self, storage_account_name, storage_account_key):
162159
for key, value in resp.items():
163160
self.assertEqual(tags[key], value)
164161

165-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
166162
@BlobPreparer()
167163
def test_get_blob_tags_for_a_snapshot(self, storage_account_name, storage_account_key):
168164
self._setup(storage_account_name, storage_account_key)
@@ -180,7 +176,6 @@ def test_get_blob_tags_for_a_snapshot(self, storage_account_name, storage_accoun
180176
for key, value in resp.items():
181177
self.assertEqual(tags[key], value)
182178

183-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
184179
@BlobPreparer()
185180
def test_upload_block_blob_with_tags(self, storage_account_name, storage_account_key):
186181
self._setup(storage_account_name, storage_account_key)
@@ -193,7 +188,6 @@ def test_upload_block_blob_with_tags(self, storage_account_name, storage_account
193188
self.assertIsNotNone(resp)
194189
self.assertEqual(len(resp), 3)
195190

196-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
197191
@BlobPreparer()
198192
def test_get_blob_properties_returns_tags_num(self, storage_account_name, storage_account_key):
199193
self._setup(storage_account_name, storage_account_key)
@@ -208,7 +202,6 @@ def test_get_blob_properties_returns_tags_num(self, storage_account_name, storag
208202
self.assertEqual(resp.tag_count, len(tags))
209203
self.assertEqual(downloaded.properties.tag_count, len(tags))
210204

211-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
212205
@BlobPreparer()
213206
def test_create_append_blob_with_tags(self, storage_account_name, storage_account_key):
214207
self._setup(storage_account_name, storage_account_key)
@@ -221,7 +214,6 @@ def test_create_append_blob_with_tags(self, storage_account_name, storage_accoun
221214
self.assertIsNotNone(resp)
222215
self.assertEqual(len(resp), 3)
223216

224-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
225217
@BlobPreparer()
226218
def test_create_page_blob_with_tags(self, storage_account_name, storage_account_key):
227219
self._setup(storage_account_name, storage_account_key)
@@ -234,7 +226,6 @@ def test_create_page_blob_with_tags(self, storage_account_name, storage_account_
234226
self.assertIsNotNone(resp)
235227
self.assertEqual(len(resp), 3)
236228

237-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
238229
@BlobPreparer()
239230
def test_commit_block_list_with_tags(self, storage_account_name, storage_account_key):
240231
self._setup(storage_account_name, storage_account_key)
@@ -257,7 +248,6 @@ def test_commit_block_list_with_tags(self, storage_account_name, storage_account
257248
self.assertIsNotNone(resp)
258249
self.assertEqual(len(resp), len(tags))
259250

260-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
261251
@BlobPreparer()
262252
def test_start_copy_from_url_with_tags(self, storage_account_name, storage_account_key):
263253
self._setup(storage_account_name, storage_account_key)
@@ -286,7 +276,6 @@ def test_start_copy_from_url_with_tags(self, storage_account_name, storage_accou
286276
self.assertIsNotNone(resp)
287277
self.assertEqual(len(resp), len(tags))
288278

289-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
290279
@BlobPreparer()
291280
def test_list_blobs_returns_tags(self, storage_account_name, storage_account_key):
292281
self._setup(storage_account_name, storage_account_key)
@@ -301,7 +290,6 @@ def test_list_blobs_returns_tags(self, storage_account_name, storage_account_key
301290
for key, value in blob.tags.items():
302291
self.assertEqual(tags[key], value)
303292

304-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
305293
@BlobPreparer()
306294
def test_filter_blobs(self, storage_account_name, storage_account_key):
307295
self._setup(storage_account_name, storage_account_key)
@@ -330,7 +318,7 @@ def test_filter_blobs(self, storage_account_name, storage_account_key):
330318
self.assertEqual(items_on_page2[0]['tags']['tag1'], 'firsttag')
331319
self.assertEqual(items_on_page2[0]['tags']['tag2'], 'secondtag')
332320

333-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
321+
@pytest.mark.skip(reason="https://github.com/Azure/azure-sdk-for-python/issues/23693 ; Test failing after resolving odd service versioning skip behavior.")
334322
@pytest.mark.live_test_only
335323
@BlobPreparer()
336324
def test_filter_blobs_using_account_sas(self, storage_account_name, storage_account_key):
@@ -362,7 +350,7 @@ def test_filter_blobs_using_account_sas(self, storage_account_name, storage_acco
362350
items_on_page1 = list(first_page)
363351
self.assertEqual(1, len(items_on_page1))
364352

365-
@pytest.mark.skipif(is_version_before(ServiceVersion.V2019_12_12), reason="SV too low")
353+
@pytest.mark.skip(reason="https://github.com/Azure/azure-sdk-for-python/issues/23693 ; Test failing after resolving odd service versioning skip behavior.")
366354
@pytest.mark.live_test_only
367355
@BlobPreparer()
368356
def test_set_blob_tags_using_blob_sas(self, storage_account_name, storage_account_key):

0 commit comments

Comments
 (0)