|
|
|
|
|
|
|
|
| from humomni.core.streaming_driver import drive
|
| from humomni.phase1.policies import SilentPolicy
|
|
|
|
|
| def test_shuffled_raises():
|
| frames = [(0.5, "a"), (1.0, "b"), (2.0, "c"), (1.5, "d")]
|
| try:
|
| drive(frames, SilentPolicy(), "qid.mp4", "q")
|
| except AssertionError:
|
| return
|
| raise SystemExit("FAIL: shuffled frames did NOT raise AssertionError (causality unguarded)")
|
|
|
|
|
| def test_ascending_ok():
|
| frames = [(0.5, "a"), (1.0, "b"), (1.5, "c")]
|
| rec = drive(frames, SilentPolicy(), "qid.mp4", "q")
|
| assert rec["question_id"] == "qid.mp4", rec
|
| assert rec["model_response_list"] == [], rec
|
|
|
|
|
| def test_equal_timestamp_raises():
|
| frames = [(0.5, "a"), (0.5, "b")]
|
| try:
|
| drive(frames, SilentPolicy(), "qid.mp4", "q")
|
| except AssertionError:
|
| return
|
| raise SystemExit("FAIL: duplicate timestamp did NOT raise (assert must be strict >)")
|
|
|
|
|
| if __name__ == "__main__":
|
| test_shuffled_raises()
|
| test_ascending_ok()
|
| test_equal_timestamp_raises()
|
| print("PASS: causality assert raises on shuffled/duplicate frames; ascending order OK.")
|
|
|