navi/backend/services/navi_offroute/tests
mj 01051be4ee navi-offroute: stub Valhalla bypass in _auto_router test helper (T3)
PR #46-48 added a road↔road Valhalla bypass (router.py:847-862) that
fires when both endpoints have "vehicle" in _auto_eligible_modes.
Two synthetic-fixture tests in test_offroute.py — both passing
elig = frozenset({"foot","2w","4w","vehicle"}) for all endpoints —
unintentionally meet that condition. On matt-desktop the bypass is
attempted but Valhalla is unreachable, so it falls through to the
unified kernel and the synthetic fixtures route as expected. On the
deploy VM Valhalla is healthy and returns real Utah forest-service
road geometry that doesn't fit the in-memory 3×20 / 4×14 grid, so
the trails[rr,cc] assertions blow up.

Fix: monkeypatch _route_D_network_only to return {"status":"error"}
inside the _auto_router test helper, forcing the bypass's existing
fall-through to the unified kernel on both CPUs deterministically.

Affected tests (both passing post-fix):
  test_route_auto_road_to_road
  test_route_auto_network_affinity_biases_path

Test-only change; production router behaviour unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 20:42:47 -06:00
..
__init__.py Add navi-offroute service (extraction #8 — final) (#10) 2026-05-22 23:30:43 -06:00
test_hpa_build.py navi-offroute: HPA* precompute pipeline (Phase H2) (#44) 2026-05-27 17:07:09 -06:00
test_hpa_runtime.py navi-offroute: HPA* runtime kernel + router dispatch (Phase H3) (#45) 2026-05-27 18:00:48 -06:00
test_mvum_annotate.py MVUM Layer 1: per-edge annotation + accurate closure counts (#23) 2026-05-25 19:32:43 -06:00
test_mvum_exclude.py MVUM Layer 2c: exclude_polygons for closure-avoiding routing (#24) 2026-05-25 19:54:28 -06:00
test_mvum_parking.py MVUM Layer 3b: OSM parking as multi-modal Auto transition candidates (#31) 2026-05-26 14:48:35 -06:00
test_mvum_spatial.py MVUM Layer 0: spatial index foundation (#22) 2026-05-25 18:53:58 -06:00
test_mvum_surface_change.py navi-offroute: delete _try_hybrid_auto + dead Auto tests (Phase 5) (#41) 2026-05-27 12:28:42 -06:00
test_mvum_transitions.py navi-offroute: delete _try_hybrid_auto + dead Auto tests (Phase 5) (#41) 2026-05-27 12:28:42 -06:00
test_offroute.py navi-offroute: stub Valhalla bypass in _auto_router test helper (T3) 2026-06-03 20:42:47 -06:00