()
| 19 | |
| 20 | @pytest.mark.django_db |
| 21 | def 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 |
nothing calls this directly
no test coverage detected