Add bounded audit-core E2 target adapter
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a0260c-4067-7052-9647-ad000d576e38
This commit is contained in:
parent
3770b41b74
commit
7396fe7d61
2 changed files with 311 additions and 0 deletions
32
tests/test_audit_core_runner.py
Normal file
32
tests/test_audit_core_runner.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import importlib.util
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
SPEC = importlib.util.spec_from_file_location(
|
||||
"audit_core_e2_runner", Path("runners/audit_core_e2.py")
|
||||
)
|
||||
runner = importlib.util.module_from_spec(SPEC)
|
||||
assert SPEC.loader is not None
|
||||
SPEC.loader.exec_module(runner)
|
||||
|
||||
|
||||
def test_equivalent_denial_includes_digest():
|
||||
base = {
|
||||
"status": 404, "content_type": "application/json", "count": 1,
|
||||
"schema": ["$", "$.error:str"], "run_digest": "same",
|
||||
}
|
||||
assert runner.equivalent(base, dict(base))
|
||||
changed = dict(base, run_digest="different")
|
||||
assert not runner.equivalent(base, changed)
|
||||
|
||||
|
||||
def test_event_is_synthetic_and_correlation_bound():
|
||||
payload = runner.event("event-a", "tenant-a", "corr")
|
||||
assert payload["id"] == payload["data"]["fixture_id"]
|
||||
assert payload["tenant"] == "tenant-a"
|
||||
assert payload["correlation_id"] == "corr"
|
||||
|
||||
|
||||
def test_p95_is_conservative_for_small_runs():
|
||||
assert runner._p95([10, 20, 30]) == 30
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue