39 lines
1.3 KiB
Python
39 lines
1.3 KiB
Python
"""Tests for EOT/INT DeepSeek suggestion validation without network calls."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import unittest
|
|
|
|
from adjudicate_easycom_eot_int_candidates import build_user_prompt, validate_decisions
|
|
|
|
|
|
class EOTINTAdjudicationTests(unittest.TestCase):
|
|
def test_prompt_contains_task_and_context(self) -> None:
|
|
prompt = build_user_prompt(
|
|
[{"uid": "u1", "task": "eot_response", "context": [{"transcription": "Yes."}]}],
|
|
0,
|
|
)
|
|
self.assertIn("eot_response", prompt)
|
|
self.assertIn("Yes.", prompt)
|
|
|
|
def test_decisions_require_exact_uid_and_vocabulary(self) -> None:
|
|
payload = {
|
|
"items": [
|
|
{
|
|
"uid": "u1",
|
|
"protocol_disposition": "hard_negative",
|
|
"hard_negative_type": "int_backchannel",
|
|
"confidence": "high",
|
|
"rationale": "Brief feedback while the wearer continues.",
|
|
}
|
|
]
|
|
}
|
|
decisions = validate_decisions(payload, ["u1"])
|
|
self.assertEqual(decisions[0]["hard_negative_type"], "int_backchannel")
|
|
with self.assertRaisesRegex(ValueError, "mismatch"):
|
|
validate_decisions({"items": []}, ["u1"])
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|