feat: extend operational investigation workflows
This commit is contained in:
@@ -218,7 +218,7 @@ def test_time_sources_and_finite_inputs_are_explicit():
|
||||
("run_simulation", {"duration": 0}),
|
||||
("run_simulation", {"duration": 86401}),
|
||||
("run_simulation", {"timeout_seconds": 0}),
|
||||
("run_simulation", {"timeout_seconds": 86401}),
|
||||
("run_simulation", {"timeout_seconds": 241}),
|
||||
("run_simulation", {"timeout_seconds": 30.5}),
|
||||
("run_simulation", {"timeout_seconds": True}),
|
||||
("run_simulation", {"output_node_ids": []}),
|
||||
@@ -316,9 +316,9 @@ def test_burst_location_optional_inputs_still_reject_partial_or_invalid_values(o
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", INPUTS)
|
||||
def test_calculations_accept_agent_execution_budget_separately_from_duration(name):
|
||||
args = arguments(name, timeout_seconds=900)
|
||||
assert args.timeout_seconds == 900
|
||||
def test_calculations_accept_http_response_budget_separately_from_duration(name):
|
||||
args = arguments(name, timeout_seconds=180)
|
||||
assert args.timeout_seconds == 180
|
||||
if hasattr(args, "duration"):
|
||||
assert args.duration == INPUTS[name].get("duration", 900)
|
||||
|
||||
@@ -350,6 +350,25 @@ def test_adapter_uses_existing_service_without_scheme_or_shared_output(monkeypat
|
||||
assert call["n_workers"] == 1
|
||||
|
||||
|
||||
@pytest.mark.parametrize("element_type", ["auto", "link", "node"])
|
||||
def test_isolation_adapter_preserves_explicit_element_type(monkeypatch, element_type):
|
||||
calls = []
|
||||
monkeypatch.setattr(
|
||||
"app.services.valve_isolation.analyze_valve_isolation",
|
||||
lambda **kwargs: calls.append(kwargs) or {"isolatable": True},
|
||||
)
|
||||
args = arguments("analyze_valve_isolation", accident_element_type=element_type)
|
||||
|
||||
asyncio.run(analysis_service.calculate(
|
||||
"analyze_valve_isolation", args, network="trusted-project", username="actor",
|
||||
))
|
||||
|
||||
assert calls[0]["accident_element_type"] == element_type
|
||||
assert calls[0]["network"] == "trusted-project"
|
||||
with pytest.raises(ValidationError):
|
||||
arguments("analyze_valve_isolation", accident_element_type="unknown")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", ["run_burst_location", "run_simulation"])
|
||||
def test_dispatch_ends_read_transaction_and_preserves_analysis_provenance(monkeypatch, name):
|
||||
order = []
|
||||
|
||||
Reference in New Issue
Block a user