camera: commento admin preciso, test timeout grab maker (Refs #106)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jbf7qKuxsnAVjxthRy7dnB
This commit is contained in:
2026-10-25 17:57:43 +01:00
parent 7cb877b11b
commit 57376556d2
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ def api_camera_sources():
if parsed.scheme not in ("http", "https") or not parsed.netloc: if parsed.scheme not in ("http", "https") or not parsed.netloc:
return jsonify({"error": True, "detail": _("Indirizzo della camera non valido")}), 400 return jsonify({"error": True, "detail": _("Indirizzo della camera non valido")}), 400
try: try:
resp = http_requests.get(f"{url.rstrip('/')}/camera/sources", timeout=15) # #106: era 5, la prima apertura GenTL supera 15 s resp = http_requests.get(f"{url.rstrip('/')}/camera/sources", timeout=15) # #106: era 5, la prima enumerazione dopo l'avvio ha preso 3,7 s
except http_requests.RequestException as exc: except http_requests.RequestException as exc:
return jsonify({ return jsonify({
"error": True, "error": True,
@@ -72,6 +72,7 @@ class TestStationCameraGrab:
args, kwargs = post.call_args args, kwargs = post.call_args
assert args[0] == "http://acq:8765/camera/grab" # slash finale tolto assert args[0] == "http://acq:8765/camera/grab" # slash finale tolto
assert kwargs["json"] == {"source": "camera:folder", "trigger": "continuo", "timeout_ms": 5000} assert kwargs["json"] == {"source": "camera:folder", "trigger": "continuo", "timeout_ms": 5000}
assert kwargs["timeout"] == 60 # #106: margine per la prima apertura GenTL
def test_get_also_works(self, logged_in_client, mock_api_client): def test_get_also_works(self, logged_in_client, mock_api_client):
_stations(mock_api_client) _stations(mock_api_client)