Skip to content

The agent that grows with you

test: consolidate video rejection variants into one invariant

Teknium11082f603ed8
diff --git a/tests/agent/test_codex_responses_adapter.py b/tests/agent/test_codex_responses_adapter.py
index 65211b57afd..47132b0b879 100644
--- a/tests/agent/test_codex_responses_adapter.py
+++ b/tests/agent/test_codex_responses_adapter.py
@@ -48,35 +48,13 @@ def test_chat_content_keeps_images_on_user_role():
}]
-def test_chat_content_rejects_video_instead_of_sending_text_only():
[email protected]("part_type", ["video_url", "video", "input_video"])
+def test_chat_content_rejects_video_instead_of_sending_text_only(part_type):
content = [
- {"type": "video_url", "video_url": {"url": "data:video/mp4;base64,AAAA"}},
+ {"type": part_type, part_type: {"url": "data:video/mp4;base64,AAAA"}},
{"type": "text", "text": "Describe the video"},
]
-
- with pytest.raises(ValueError, match="does not support video_url input"):
- _chat_messages_to_responses_input([{"role": "user", "content": content}])
-
-
-def test_chat_content_rejects_video_type_instead_of_sending_text_only():
- """``video`` type (without _url suffix) must also fail closed."""
- content = [
- {"type": "video", "video": {"url": "data:video/mp4;base64,AAAA"}},
- {"type": "text", "text": "Describe the video"},
- ]
-
- with pytest.raises(ValueError, match="does not support video input"):
- _chat_messages_to_responses_input([{"role": "user", "content": content}])
-
-
-def test_chat_content_rejects_input_video_type_instead_of_sending_text_only():
- """``input_video`` type (Responses API native) must also fail closed."""
- content = [
- {"type": "input_video", "input_video": {"url": "data:video/mp4;base64,AAAA"}},
- {"type": "text", "text": "Describe the video"},
- ]
-
- with pytest.raises(ValueError, match="does not support input_video input"):
+ with pytest.raises(ValueError, match=f"does not support {part_type} input"):
_chat_messages_to_responses_input([{"role": "user", "content": content}])