fix(investigation): allow autonomous model baseline recovery
This commit is contained in:
@@ -99,6 +99,27 @@ def test_unknown_units_do_not_draw_an_impact_area(inputs):
|
||||
inputs.assert_not_called()
|
||||
|
||||
|
||||
def test_missing_online_baseline_offers_recalculation_then_coverage_can_be_retried(inputs):
|
||||
inputs.side_effect = None
|
||||
inputs.return_value = {}
|
||||
native = simulation([2, 4, 6])
|
||||
missing = service.estimate_burst_impact("own", START, native)
|
||||
assert missing["impact"]["reason"] == "no_exact_comparable_online_snapshot"
|
||||
recovery = missing["impact"]["baseline_recovery"]
|
||||
assert recovery["tool"] == "run_simulation"
|
||||
assert recovery["parameters"] == {
|
||||
"start_time": START.isoformat(), "duration": 60, "output_node_ids": ["J0"],
|
||||
}
|
||||
assert "map_payload" not in missing
|
||||
|
||||
inputs.return_value = {
|
||||
f"J{i}": [{"time": START.isoformat(), "value": 30}] for i in range(3)
|
||||
}
|
||||
retried = service.estimate_burst_impact("own", START, native)
|
||||
assert retried["impact"]["status"] == "ready"
|
||||
assert len(retried["map_payload"]["features"]) == 3
|
||||
|
||||
|
||||
def test_full_native_network_compared_before_selected_series_filter(monkeypatch, inputs):
|
||||
from app.mcp import scenario_service
|
||||
from app.services import simulation_scenarios
|
||||
|
||||
Reference in New Issue
Block a user