mirror of
https://github.com/azaion/detections.git
synced 2026-04-22 10:56:32 +00:00
[AZ-180] Refactor detection event handling and improve SSE support
- Updated the detection image endpoint to require a channel ID for event streaming. - Introduced a new endpoint for streaming detection events, allowing clients to receive real-time updates. - Enhanced the internal buffering mechanism for detection events to manage multiple channels. - Refactored the inference module to support the new event handling structure. Made-with: Cursor
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
|
||||
@@ -41,6 +43,8 @@ def test_ft_n_03_loader_error_mode_detect_does_not_500(
|
||||
f"{mock_loader_url}/mock/config", json={"mode": "error"}, timeout=10
|
||||
)
|
||||
cfg.raise_for_status()
|
||||
channel_id = str(uuid.uuid4())
|
||||
headers = {**auth_headers, "X-Channel-Id": channel_id}
|
||||
files = {"file": ("small.jpg", image_small, "image/jpeg")}
|
||||
r = http_client.post("/detect/image", files=files, headers=auth_headers, timeout=_DETECT_TIMEOUT)
|
||||
r = http_client.post("/detect/image", files=files, headers=headers, timeout=_DETECT_TIMEOUT)
|
||||
assert r.status_code != 500
|
||||
|
||||
Reference in New Issue
Block a user