feat: extend operational investigation workflows
Generic Container CI/CD / test-build-publish (push) Successful in 3m53s
Server CI/CD v2 / build-test-publish-and-deploy (push) Successful in 3m52s

This commit is contained in:
2026-10-30 17:30:19 +08:00
parent 63af998045
commit 05183aff93
82 changed files with 4644 additions and 330 deletions
@@ -54,3 +54,35 @@ def test_overlay_rejects_missing_or_invalid_recorded_spatial_data(data):
def test_presentation_input_rejects_free_form_or_invalid_commands(command):
with pytest.raises(ValidationError):
TaskPresentationEventCommand(request_id=uuid4(), run_id=uuid4(), source_session_id="session", command=command)
@pytest.mark.parametrize("command", [
{"action": "locate_features", "layer": "scada", "feature_ids": ["D-1"]},
{"action": "zoom_to_map", "center": [121.4, 31.1], "zoom": 24},
{"action": "render_scada_analysis", "items": [{"device_id": "D-1", "level": "unrated"}]},
{"action": "clear_scada_analysis"},
])
def test_unified_presentation_commands_preserve_flat_shape(command):
event = TaskPresentationEventCommand(request_id=uuid4(), run_id=uuid4(), source_session_id="session", command=command)
assert event.command.model_dump(mode="json") == command
@pytest.mark.parametrize("command", [
{"action": "highlight_features", "layer": "pipes", "feature_ids": ["P-1"]},
{"action": "locate_features", "layer": "pipes", "feature_ids": []},
{"action": "zoom_to_map", "center": [181, 31], "zoom": 1},
{"action": "zoom_to_map", "center": [121, 91], "zoom": 1},
{"action": "zoom_to_map", "center": [121, 31, 0], "zoom": 1},
{"action": "zoom_to_map", "center": [True, 31], "zoom": 1},
{"action": "zoom_to_map", "center": [121, 31], "zoom": 25},
{"action": "zoom_to_map", "center": [121, 31], "zoom": -1},
{"action": "render_scada_analysis", "items": [{"device_id": "D", "level": "urgent"}]},
{"action": "render_scada_analysis", "items": [{"device_id": "D", "level": "high"}] * 2},
{"action": "render_scada_analysis", "items": [{"device_id": str(i), "level": "low"} for i in range(101)]},
{"action": "open_chart", "chart_id": "X", "evidence_refs": [], "chart": {
"title": "X", "chart_type": "line", "x_data": ["t"], "series": [{"name": "s", "data": [1]}],
}},
])
def test_unified_presentation_rejects_invalid_commands(command):
with pytest.raises(ValidationError):
TaskPresentationEventCommand(request_id=uuid4(), run_id=uuid4(), source_session_id="session", command=command)