[7f2c881a] fix(video): cast task.id to UUID before VideoEngine.rerender calls

mypy flagged task.id as sqlalchemy.sql.sqltypes.UUID[Any] rather than
uuid.UUID in the three rerender tests; cast to UUID per the codebase's
established idiom (cast("UUID", obj.id)) used elsewhere for the same
SQLAlchemy Mapped-attribute inference gap.
This commit is contained in:
Backend Developer 1
2026-07-10 05:21:11 +00:00
parent 88ab5c6dc5
commit f2a087029b
+7 -7
View File
@@ -8,9 +8,9 @@ Secretary-owned and held for the CEO. Asserted against a real Postgres DB.
from __future__ import annotations from __future__ import annotations
from typing import TYPE_CHECKING from typing import TYPE_CHECKING, cast
from unittest.mock import AsyncMock from unittest.mock import AsyncMock
from uuid import uuid4 from uuid import UUID, uuid4
import pytest import pytest
from roboco.config import settings as cfg from roboco.config import settings as cfg
@@ -342,7 +342,7 @@ async def test_open_video_task_with_explicit_project_id_ignores_self_heal_slug(
script="s", script="s",
platforms=["x"], platforms=["x"],
brief="b", brief="b",
project_id=other.id, project_id=cast("UUID", other.id),
) )
assert task is not None assert task is not None
assert task.project_id == other.id assert task.project_id == other.id
@@ -373,7 +373,7 @@ async def test_open_video_task_explicit_project_id_not_opted_in_opens_nothing(
script="s", script="s",
platforms=["x"], platforms=["x"],
brief="b", brief="b",
project_id=other.id, project_id=cast("UUID", other.id),
) )
assert task is None assert task is None
@@ -764,7 +764,7 @@ async def test_rerender_clears_render_state_keeps_the_rest(
task.status = TS.COMPLETED task.status = TS.COMPLETED
await db_session.flush() await db_session.flush()
result = await engine.rerender(task.id) result = await engine.rerender(cast("UUID", task.id))
assert result is not None assert result is not None
cleared = markers.get_video_draft(result) cleared = markers.get_video_draft(result)
assert cleared is not None assert cleared is not None
@@ -789,7 +789,7 @@ async def test_rerender_none_for_non_completed_task(
markers.set_video_draft(task, {**draft, "composition_id": "Intro"}) markers.set_video_draft(task, {**draft, "composition_id": "Intro"})
await db_session.flush() # still PENDING, not COMPLETED await db_session.flush() # still PENDING, not COMPLETED
result = await engine.rerender(task.id) result = await engine.rerender(cast("UUID", task.id))
assert result is None assert result is None
@@ -807,7 +807,7 @@ async def test_rerender_none_without_composition_id(
task.status = TS.COMPLETED task.status = TS.COMPLETED
await db_session.flush() # no propose_video call yet -> no composition_id await db_session.flush() # no propose_video call yet -> no composition_id
result = await engine.rerender(task.id) result = await engine.rerender(cast("UUID", task.id))
assert result is None assert result is None