test(unraid): complete contract coverage and retain WS samples
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import hmac
|
||||
import math
|
||||
import queue
|
||||
import threading
|
||||
@@ -10,6 +11,10 @@ from typing import Any
|
||||
import numpy as np
|
||||
|
||||
|
||||
def valid_bearer(header: str | None, token: str) -> bool:
|
||||
return bool(header and header.startswith("Bearer ") and hmac.compare_digest(header[7:], token))
|
||||
|
||||
|
||||
def finite01(value: float) -> float:
|
||||
value = float(value)
|
||||
return min(1.0, max(0.0, value)) if math.isfinite(value) else 0.0
|
||||
@@ -88,4 +93,3 @@ class Frame:
|
||||
pixels: np.ndarray
|
||||
received_ns: int
|
||||
decode_ms: float
|
||||
|
||||
|
||||
Reference in New Issue
Block a user