@@ -213,36 +213,55 @@ def test_pdf_mal_bbox(client, configured_project_pdf):
213213 "page" : random .randint (0 , 1 ),
214214 "unit" : "POINTS"
215215 })
216- annotations .extend ([{
217- 'name' : 'text' ,
218- 'answer' : 'the answer to the text question' ,
219- 'uuid' : 'fc1913c6-b735-4dea-bd25-c18152a4715f' ,
220- "dataRow" : {
221- "id" : row ['id' ]
222- }
223- }, {
224- 'name' :
225- 'checklist' ,
226- 'uuid' :
227- '9d7b2e57-d68f-4388-867a-af2a9b233719' ,
228- "dataRow" : {
229- "id" : row ['id' ]
216+ annotations .extend ([
217+ { #annotations intended to test classifications
218+ 'name' : 'text' ,
219+ 'answer' : 'the answer to the text question' ,
220+ 'uuid' : 'fc1913c6-b735-4dea-bd25-c18152a4715f' ,
221+ "dataRow" : {
222+ "id" : row ['id' ]
223+ }
230224 },
231- 'answer' : [{
232- 'name' : 'first_checklist_answer'
233- }, {
234- 'name' : 'second_checklist_answer'
235- }]
236- }, {
237- 'name' : 'radio' ,
238- 'answer' : {
239- 'name' : 'second_radio_answer'
225+ {
226+ 'name' :
227+ 'checklist' ,
228+ 'uuid' :
229+ '9d7b2e57-d68f-4388-867a-af2a9b233719' ,
230+ "dataRow" : {
231+ "id" : row ['id' ]
232+ },
233+ 'answer' : [{
234+ 'name' : 'first_checklist_answer'
235+ }, {
236+ 'name' : 'second_checklist_answer'
237+ }]
240238 },
241- 'uuid' : 'ad60897f-ea1a-47de-b923-459339764921' ,
242- "dataRow" : {
243- "id" : row ['id' ]
239+ {
240+ 'name' : 'radio' ,
241+ 'answer' : {
242+ 'name' : 'second_radio_answer'
243+ },
244+ 'uuid' : 'ad60897f-ea1a-47de-b923-459339764921' ,
245+ "dataRow" : {
246+ "id" : row ['id' ]
247+ }
248+ },
249+ { #adding this with the intention to ensure we allow page: 0
250+ "uuid" : str (uuid .uuid4 ()),
251+ "name" : "bbox" ,
252+ "dataRow" : {
253+ "id" : row ['id' ]
254+ },
255+ "bbox" : {
256+ "top" : round (random .uniform (0 , 300 ), 2 ),
257+ "left" : round (random .uniform (0 , 300 ), 2 ),
258+ "height" : round (random .uniform (200 , 500 ), 2 ),
259+ "width" : round (random .uniform (0 , 200 ), 2 )
260+ },
261+ "page" : 0 ,
262+ "unit" : "POINTS"
244263 }
245- } ])
264+ ])
246265 import_annotations = MALPredictionImport .create_from_objects (
247266 client = client ,
248267 project_id = configured_project_pdf .uid ,
0 commit comments