Skip to content

Commit 7c245c0

Browse files
committed
update to test cases
1 parent 9c1ed73 commit 7c245c0

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

tests/integration/test_data_rows.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import requests
77

88
from labelbox import DataRow
9-
from labelbox.exceptions import InvalidQueryError, MalformedQueryException
109

1110

1211
def test_get_data_row(datarow, client):
@@ -279,17 +278,14 @@ def test_create_data_rows_sync_mixed_upload(dataset, image_url):
279278

280279

281280
def test_delete_data_row_attachment(datarow, image_url):
282-
attachment_uids = []
283-
attachments = [("IMAGE", image_url), ("TEXT", "test-text"),
284-
("IMAGE_OVERLAY", image_url), ("HTML", image_url)]
285-
for attachment_type, attachment_value in attachments:
286-
attachment_uids.append(
287-
datarow.create_attachment(attachment_type, attachment_value).uid)
281+
attachments = []
282+
to_attach = [("IMAGE", image_url), ("TEXT", "test-text"),
283+
("IMAGE_OVERLAY", image_url), ("HTML", image_url)]
284+
for attachment_type, attachment_value in to_attach:
285+
attachments.append(
286+
datarow.create_attachment(attachment_type, attachment_value))
288287

289-
for uid in attachment_uids:
290-
datarow.delete_attachment(uid)
288+
for attachment in attachments:
289+
attachment.delete()
291290

292291
assert len(list(datarow.attachments())) == 0
293-
294-
with pytest.raises(MalformedQueryException):
295-
datarow.delete_attachment("not valid id")

0 commit comments

Comments
 (0)