MCPcopy Create free account
hub / github.com/Emmimal/control-layer / test_pass_rate

Method test_pass_rate

tests/test_control_layer.py:436–444  ·  view source on GitHub ↗
(self, tmp_path)

Source from the content-addressed store, hash-verified

434 assert dist["timeout"] == 1
435
436 def test_pass_rate(self, tmp_path):
437 logger = AuditLogger(str(tmp_path / "audit.jsonl"))
438 for passed in [True, True, False]:
439 logger.log(AuditRecord(
440 audit_id="id", timestamp="t", prompt_hash="h",
441 attempt=1, failure_mode=FailureMode.NONE, latency_ms=1.0,
442 token_count=10, passed=passed, strategy=RetryStrategy.NONE,
443 ))
444 assert abs(logger.pass_rate() - 2/3) < 0.01
445
446 def test_thread_safe_writes(self, tmp_path):
447 logger = AuditLogger(str(tmp_path / "audit.jsonl"))

Callers

nothing calls this directly

Calls 4

logMethod · 0.95
pass_rateMethod · 0.95
AuditLoggerClass · 0.90
AuditRecordClass · 0.90

Tested by

no test coverage detected