File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 22import pytest
33import requests
44from labelbox import Dataset
5- from labelbox .exceptions import ResourceNotFoundError , MalformedQueryException
5+ from labelbox .exceptions import ResourceNotFoundError , MalformedQueryException , InvalidQueryError
66from 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+
106133def test_bulk_conversation (dataset , sample_bulk_conversation : list ) -> None :
107134 """
108135 Tests that bulk conversations can be uploaded.
You can’t perform that action at this time.
0 commit comments