50 lines
1.5 KiB
Python
50 lines
1.5 KiB
Python
"""Shared fixtures for ``alfred.application.movies`` tests."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from datetime import UTC, datetime
|
|
|
|
import pytest
|
|
|
|
from alfred.domain.releases_TO_CHECK.entities import MovieRelease, TrackProfile
|
|
from alfred.domain.shared_TO_CHECK.media import AudioTrack
|
|
from alfred.domain.shared_TO_CHECK.value_objects import FilePath, ImdbId, TmdbId
|
|
|
|
|
|
@pytest.fixture
|
|
def movie_library(tmp_path):
|
|
"""Empty ``movies/`` with an Inception folder ready for sidecars."""
|
|
root = tmp_path / "movies"
|
|
root.mkdir()
|
|
(root / "Inception.2010.1080p.BluRay.x264-GROUP").mkdir()
|
|
return root
|
|
|
|
|
|
@pytest.fixture
|
|
def inception_release() -> MovieRelease:
|
|
"""Minimal Inception MovieRelease — enough for index assertions."""
|
|
return MovieRelease(
|
|
tmdb_id=TmdbId(27205),
|
|
imdb_id=ImdbId("tt1375666"),
|
|
folder="Inception.2010.1080p.BluRay.x264-GROUP",
|
|
file_path=FilePath("Inception.2010.1080p.BluRay.x264-GROUP.mkv"),
|
|
added_at=datetime(2026, 5, 25, 8, 30, 0, tzinfo=UTC),
|
|
tracks=TrackProfile(
|
|
audio_tracks=(
|
|
AudioTrack(
|
|
index=0,
|
|
codec="dts",
|
|
channels=8,
|
|
channel_layout="7.1",
|
|
language="eng",
|
|
),
|
|
),
|
|
),
|
|
)
|
|
|
|
|
|
@pytest.fixture
|
|
def now_utc() -> datetime:
|
|
"""Stable UTC reference for deterministic fetched_at fields."""
|
|
return datetime(2026, 5, 25, 8, 30, 0, tzinfo=UTC)
|