Skip to content

Commit 6b9f0e3

Browse files
author
Matt Sokoloff
committed
add more tests
1 parent 272e149 commit 6b9f0e3

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

tests/integration/test_dataset.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import pytest
33
import requests
44
from labelbox import Dataset
5-
from labelbox.exceptions import ResourceNotFoundError, MalformedQueryException
5+
from labelbox.exceptions import ResourceNotFoundError, MalformedQueryException, InvalidQueryError
66
from labelbox.schema.dataset import MAX_DATAROW_PER_API_OPERATION
77

88

@@ -103,6 +103,33 @@ def test_upload_video_file(dataset, sample_video: str) -> None:
103103
assert response.headers['Content-Type'] == 'video/mp4'
104104

105105

106+
def test_create_pdf(dataset):
107+
dataset.create_data_row(
108+
row_data={
109+
"pdfUrl":
110+
"https://lb-test-data.s3.us-west-1.amazonaws.com/document-samples/sample-document-1.pdf",
111+
"textLayerUrl":
112+
"https://lb-test-data.s3.us-west-1.amazonaws.com/document-samples/sample-document-custom-text-layer.json"
113+
})
114+
dataset.create_data_row(row_data={
115+
"pdfUrl":
116+
"https://lb-test-data.s3.us-west-1.amazonaws.com/document-samples/sample-document-1.pdf",
117+
"textLayerUrl":
118+
"https://lb-test-data.s3.us-west-1.amazonaws.com/document-samples/sample-document-custom-text-layer.json"
119+
},
120+
media_type="PDF")
121+
122+
with pytest.raises(InvalidQueryError):
123+
# Wrong media type
124+
dataset.create_data_row(row_data={
125+
"pdfUrl":
126+
"https://lb-test-data.s3.us-west-1.amazonaws.com/document-samples/sample-document-1.pdf",
127+
"textLayerUrl":
128+
"https://lb-test-data.s3.us-west-1.amazonaws.com/document-samples/sample-document-custom-text-layer.json"
129+
},
130+
media_type="TEXT")
131+
132+
106133
def test_bulk_conversation(dataset, sample_bulk_conversation: list) -> None:
107134
"""
108135
Tests that bulk conversations can be uploaded.

0 commit comments

Comments
 (0)