File size: 815 Bytes
f440f03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Tests video ģenerēšanai."""

from unittest.mock import AsyncMock, patch

import pytest
from fastapi import HTTPException

from maris_core.video.generate_video import VideoRequest, generate_video


@pytest.mark.asyncio
async def test_generate_video_requires_explicit_maris_model() -> None:
    """Pārbauda, ka video ģenerēšana neatgriež tukšu fallback."""
    with (
        patch(
            "maris_core.utils.hf_integration.HFIntegration.save_generation",
            new_callable=AsyncMock,
        ),
        patch.dict("os.environ", {"VIDEO_MODEL": ""}, clear=False),
    ):
        req = VideoRequest(prompt="latvijas daba pavasarī", duration_seconds=3)
        with pytest.raises(HTTPException) as exc_info:
            await generate_video(req)
        assert exc_info.value.status_code == 503