| """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 |
|
|