test(server): align service access delegation expectation
This commit is contained in:
@@ -76,7 +76,7 @@ async def test_data_query_requires_task_grant_before_source_request(monkeypatch)
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.anyio
|
@pytest.mark.anyio
|
||||||
async def test_approved_task_source_uses_server_delegation(monkeypatch):
|
async def test_preconfigured_service_access_avoids_server_delegation(monkeypatch):
|
||||||
now = datetime(2026, 9, 24, 8, tzinfo=timezone.utc)
|
now = datetime(2026, 9, 24, 8, tzinfo=timezone.utc)
|
||||||
snapshot = TaskDataSnapshot(source="scada_devices", source_ref="scada_devices:sha256:test",
|
snapshot = TaskDataSnapshot(source="scada_devices", source_ref="scada_devices:sha256:test",
|
||||||
queried_at=now, origin="system_data", data={"items": []}, truncated=False)
|
queried_at=now, origin="system_data", data={"items": []}, truncated=False)
|
||||||
@@ -93,6 +93,6 @@ async def test_approved_task_source_uses_server_delegation(monkeypatch):
|
|||||||
uuid4(), TaskDataQuery(source="scada_devices"), authorization="Bearer AGENT",
|
uuid4(), TaskDataQuery(source="scada_devices"), authorization="Bearer AGENT",
|
||||||
ctx=_service_context(), conn=object(),
|
ctx=_service_context(), conn=object(),
|
||||||
)
|
)
|
||||||
assert source.await_args.kwargs["delegated"] is True
|
assert source.await_args.kwargs["delegated"] is False
|
||||||
assert result.evidence.evidence_id == snapshot.source_ref
|
assert result.evidence.evidence_id == snapshot.source_ref
|
||||||
service.record_data_snapshot.assert_awaited_once()
|
service.record_data_snapshot.assert_awaited_once()
|
||||||
|
|||||||
Reference in New Issue
Block a user