oclaw/tests/test_chat_attachments_payload.py
oliver 4335040a27 feat(video): DashScope video specialist with correct i2v request bodies
- Add video_generation_client: async video-synthesis, t2v vs i2v (Wan 2.7 input.media first_frame vs legacy img_url).

- Coerce *-t2v* to *-i2v* when first frame present; AIA_VIDEO_I2V_INPUT_STYLE / I2V_MODEL overrides.

- Gateway/direct_loop early return for video specialist; workspace video + factory allowlist.

- Normalize WS and admin chat attachments (image_ref parity); mp4 attachment store roundtrip tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-10 16:20:43 +08:00

27 lines
916 B
Python

"""Regression: admin REST and WS share attachment normalization (typed refs must survive parsing)."""
from __future__ import annotations
from oclaw.interfaces.admin.chat_api import _parse_attachments_payload
def test_parse_attachments_payload_preserves_image_ref() -> None:
att: dict = {"type": "image_ref", "attachment_id": "a" * 64, "mime": "image/png"}
out = _parse_attachments_payload([att])
assert out == [att]
def test_parse_attachments_payload_preserves_relay_pointer_image() -> None:
att: dict = {
"type": "relay_pointer",
"mime": "image/jpeg",
"attachment_id": "b" * 64,
"pointer_uri": "relay://attachments/x/" + "b" * 64,
}
out = _parse_attachments_payload([att])
assert out == [att]
def test_parse_attachments_payload_empty() -> None:
assert _parse_attachments_payload(None) is None
assert _parse_attachments_payload([]) is None