@@ -271,46 +271,38 @@ def test_import_mal_annotations(
271
271
def test_audio_temporal_annotations_fixtures ():
272
272
"""Test that audio temporal annotation fixtures are properly structured"""
273
273
# This test verifies our fixtures work without requiring the full integration environment
274
-
274
+
275
275
# Mock prediction_id_mapping structure that our fixtures expect
276
276
mock_prediction_id_mapping = [
277
277
{
278
278
"checklist" : {
279
279
"tool" : "checklist_tool" ,
280
280
"name" : "checklist" ,
281
- "value" : "checklist"
282
- },
283
- "text" : {
284
- "tool" : "text_tool" ,
285
- "name" : "text" ,
286
- "value" : "text"
281
+ "value" : "checklist" ,
287
282
},
288
- "radio" : {
289
- "tool" : "radio_tool" ,
290
- "name" : "radio" ,
291
- "value" : "radio"
292
- }
283
+ "text" : {"tool" : "text_tool" , "name" : "text" , "value" : "text" },
284
+ "radio" : {"tool" : "radio_tool" , "name" : "radio" , "value" : "radio" },
293
285
}
294
286
]
295
-
287
+
296
288
# Test that our fixtures can process the mock data
297
289
# Note: We can't actually call the fixtures directly in a unit test,
298
290
# but we can verify the structure is correct by checking the fixture definitions
299
-
291
+
300
292
# Verify that our fixtures are properly defined and accessible
301
293
from .conftest import (
302
294
audio_checklist_inference ,
303
- audio_text_inference ,
295
+ audio_text_inference ,
304
296
audio_radio_inference ,
305
- audio_text_entity_inference
297
+ audio_text_entity_inference ,
306
298
)
307
-
299
+
308
300
# Check that all required fixtures exist
309
301
assert audio_checklist_inference is not None
310
302
assert audio_text_inference is not None
311
303
assert audio_radio_inference is not None
312
304
assert audio_text_entity_inference is not None
313
-
305
+
314
306
# Verify the fixtures are callable (they should be functions)
315
307
assert callable (audio_checklist_inference )
316
308
assert callable (audio_text_inference )
@@ -327,18 +319,18 @@ def test_audio_temporal_annotations_integration(
327
319
"""Test that audio temporal annotations work correctly in the integration framework"""
328
320
# Filter to only audio annotations
329
321
audio_annotations = annotations_by_media_type [MediaType .Audio ]
330
-
322
+
331
323
# Verify we have the expected audio temporal annotations
332
324
assert len (audio_annotations ) == 4 # checklist, text, radio, text_entity
333
-
325
+
334
326
# Check that temporal annotations have frame information
335
327
for annotation in audio_annotations :
336
328
if "frame" in annotation :
337
329
assert isinstance (annotation ["frame" ], int )
338
330
assert annotation ["frame" ] >= 0
339
331
# Verify frame values are in milliseconds (reasonable range for audio)
340
332
assert annotation ["frame" ] <= 600000 # 10 minutes max
341
-
333
+
342
334
# Test import with audio temporal annotations
343
335
label_import = lb .LabelImport .create_from_objects (
344
336
client ,
@@ -347,11 +339,11 @@ def test_audio_temporal_annotations_integration(
347
339
audio_annotations ,
348
340
)
349
341
label_import .wait_until_done ()
350
-
342
+
351
343
# Verify import was successful
352
344
assert label_import .state == AnnotationImportState .FINISHED
353
345
assert len (label_import .errors ) == 0
354
-
346
+
355
347
# Verify all annotations were imported successfully
356
348
all_annotations = sorted ([a ["uuid" ] for a in audio_annotations ])
357
349
successful_annotations = sorted (
0 commit comments