feat(k1): stabilize LAB bridge and isolate onboard device integration

This commit is contained in:
DCCONSTRUCTIONS
2026-09-07 10:31:33 +03:00
parent 020a878915
commit 63ea2bed67
115 changed files with 13700 additions and 988 deletions
+30
View File
@@ -36,6 +36,36 @@ def _endpoint(router: APIRouter, path: str, method: str) -> Callable[..., Any]:
raise AssertionError(f"{method} {path} route is missing")
@pytest.mark.parametrize(
("primary", "secondary", "expected"),
[
("spatial-scene", "cameras", ("cameras", None)),
("spatial-scene", None, ("cameras", None)),
("telemetry", "spatial-scene", ("telemetry", None)),
("objects", "world-map", ("objects", "world-map")),
],
)
def test_lab_scene_move_preserves_other_operator_settings(
tmp_path: Path, primary: str, secondary: str | None, expected: tuple[str, str | None]
) -> None:
store = EnvironmentSettingsStore(tmp_path)
original = default_environment_settings()
original.revision = 19
page = original.pages.observation
page.header_label = "Контроль"
page.primary_workspace_id = primary
page.secondary_workspace_id = secondary
store.settings_path.write_text(original.model_dump_json())
restored = store.read()
assert restored.revision == 19
assert restored.pages.observation.header_label == "Контроль"
assert restored.pages.observation.background == original.pages.observation.background
assert (restored.pages.observation.primary_workspace_id,
restored.pages.observation.secondary_workspace_id) == expected
assert restored.pages.home == original.pages.home
assert restored.pages.polygon == original.pages.polygon
def _streaming_request(payload: bytes, media_type: str) -> Request:
chunks = iter((payload[:8], payload[8:]))