feat(web-console): rebuild intelligent cockpit sync interface
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import tempfile
|
||||
import time
|
||||
from pathlib import Path
|
||||
@@ -10,6 +11,41 @@ from cognitive_agent.application.calibration import protocol
|
||||
from cognitive_agent.application.calibration.service import ApiError, CalibrationService
|
||||
|
||||
|
||||
def test_video_settings_use_webrtc_and_migrate_legacy_rtsp() -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory)
|
||||
data_dir = root / "data"
|
||||
data_dir.mkdir()
|
||||
(data_dir / "settings.json").write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"mqtt": {"host": "172.20.10.12", "port": 1883, "topic": "zed/seatpose"},
|
||||
"video": {
|
||||
"scheme": "http",
|
||||
"host": "172.20.10.12",
|
||||
"port": 8554,
|
||||
"path": "zed",
|
||||
"transport": "webrtc",
|
||||
},
|
||||
}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
service = CalibrationService(root)
|
||||
settings = service.snapshot()["settings"]
|
||||
|
||||
assert settings["mqtt"]["host"] == "172.20.10.6"
|
||||
assert settings["video"] == {
|
||||
"scheme": "http",
|
||||
"host": "172.20.10.6",
|
||||
"port": 8889,
|
||||
"path": "zed",
|
||||
"transport": "webrtc",
|
||||
}
|
||||
assert service.start_video()["video"]["state"] == "ready"
|
||||
|
||||
|
||||
def test_protocol_matches_android_golden_vectors() -> None:
|
||||
assert protocol.crc8(b"123456789") == 0x4B
|
||||
vectors = (
|
||||
|
||||
Reference in New Issue
Block a user