feat: finalize corrected-route planning and Rerun recording review

This commit is contained in:
DCCONSTRUCTIONS
2026-09-22 10:10:03 +03:00
parent c804d89b18
commit 2e5d52521f
132 changed files with 14141 additions and 898 deletions
+19
View File
@@ -66,6 +66,25 @@ def test_draft_persists_full_route_and_optimistic_revision(tmp_path):
assert service.get(first['id']) == next
def test_whole_recording_is_resolved_by_server_and_old_report_stays_frozen(tmp_path):
service = MissionDrafts(tmp_path, Sources())
old = service.save(request())
full = service.save(request(id=old['id'], revision=1, whole_recording=True,
start_index=1, end_index=2))
assert (full['route']['start_index'], full['route']['end_index']) == (0, 3)
assert full['route']['length_m'] == 15
assert old['route']['length_m'] == 10
app = FastAPI()
app.include_router(build_mission_planner_router(service))
with TestClient(app) as client:
body = {'name': 'Full', 'session_id': 'session-a', 'generation': 'a'*64,
'whole_recording': True, 'direction': 'reverse'}
response = client.post('/api/v1/mission-planner/drafts', json=body)
assert response.status_code == 200
assert [p['source_index'] for p in response.json()['route']['points']] == [3, 2, 1, 0]
assert client.post('/api/v1/mission-planner/drafts', json={**body, 'whole_recording': False}).status_code == 409
@pytest.mark.parametrize('start,end', [(2, 2), (3, 1), (-1, 2), (0, 4)])
def test_route_rejects_out_of_bounds(start, end):
with pytest.raises(ValueError): route_from_source(source_doc(), start, end, 'forward')