MCPcopy
hub / github.com/photonixapp/photonix / test_classifier_batch

Function test_classifier_batch

tests/test_classifier_batch.py:21–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19
20@pytest.mark.django_db
21def test_classifier_batch():
22 photo = PhotoFactory()
23 PhotoFileFactory(photo=photo)
24
25 for _ in range(4):
26 TaskFactory(subject_id=photo.id)
27
28 start = time()
29
30 threaded_queue_processor = ThreadedQueueProcessor(model, 'classify.style', run_on_photo, 1, 64)
31 threaded_queue_processor.run(loop=False)
32
33 assert time() - start > 0
34 assert time() - start < 100
35 assert photo.photo_tags.count() == 1
36 assert photo.photo_tags.all()[0].tag.name == 'serene'
37 assert photo.photo_tags.all()[0].confidence > 0.9

Callers

nothing calls this directly

Calls 5

runMethod · 0.95
PhotoFactoryClass · 0.85
PhotoFileFactoryClass · 0.85
TaskFactoryClass · 0.85

Tested by

no test coverage detected