Skip to content

Commit 4ee7cf8

Browse files
committed
Add unit tests
1 parent e807e77 commit 4ee7cf8

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tests/integration/test_data_rows.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -621,16 +621,17 @@ def test_data_row_iteration(dataset, image_url) -> None:
621621

622622

623623
def test_data_row_attachments(dataset, image_url):
624-
attachments = [("IMAGE", image_url), ("TEXT", "test-text"),
625-
("IMAGE_OVERLAY", image_url), ("HTML", image_url)]
624+
attachments = [("IMAGE", image_url, "attachment image"), ("TEXT", "test-text", None),
625+
("IMAGE_OVERLAY", image_url, "Overlay"), ("HTML", image_url)]
626626
task = dataset.create_data_rows([{
627627
"row_data": image_url,
628628
"external_id": "test-id",
629629
"attachments": [{
630630
"type": attachment_type,
631-
"value": attachment_value
631+
"value": attachment_value,
632+
"name": attachment_name
632633
}]
633-
} for attachment_type, attachment_value in attachments])
634+
} for attachment_type, attachment_value, attachment_name in attachments])
634635

635636
task.wait_till_done()
636637
assert task.status == "COMPLETE"
@@ -652,8 +653,8 @@ def test_data_row_attachments(dataset, image_url):
652653

653654

654655
def test_create_data_rows_sync_attachments(dataset, image_url):
655-
attachments = [("IMAGE", image_url), ("TEXT", "test-text"),
656-
("IMAGE_OVERLAY", image_url), ("HTML", image_url)]
656+
attachments = [("IMAGE", image_url, "image URL"), ("TEXT", "test-text", None),
657+
("IMAGE_OVERLAY", image_url, "Overlay"), ("HTML", image_url, None)]
657658
attachments_per_data_row = 3
658659
dataset.create_data_rows_sync([{
659660
"row_data":
@@ -662,9 +663,10 @@ def test_create_data_rows_sync_attachments(dataset, image_url):
662663
"test-id",
663664
"attachments": [{
664665
"type": attachment_type,
665-
"value": attachment_value
666+
"value": attachment_value,
667+
"name": attachment_name
666668
} for _ in range(attachments_per_data_row)]
667-
} for attachment_type, attachment_value in attachments])
669+
} for attachment_type, attachment_value, attachment_name in attachments])
668670
data_rows = list(dataset.data_rows())
669671
assert len(data_rows) == len(attachments)
670672
for data_row in data_rows:

0 commit comments

Comments
 (0)