chore: apply pre-commit auto-fixes (trim trailing whitespace, EOF)
This commit is contained in:
@@ -20,8 +20,9 @@ from alfred.domain.shared.media import AudioTrack, MediaInfo, SubtitleTrack, Vid
|
||||
|
||||
class TestTracks:
|
||||
def test_audio_track_defaults(self):
|
||||
t = AudioTrack(index=0, codec="aac", channels=2, channel_layout="stereo",
|
||||
language="eng")
|
||||
t = AudioTrack(
|
||||
index=0, codec="aac", channels=2, channel_layout="stereo", language="eng"
|
||||
)
|
||||
assert t.is_default is False
|
||||
|
||||
def test_subtitle_track_defaults(self):
|
||||
@@ -36,7 +37,9 @@ class TestTracks:
|
||||
|
||||
class TestVideoTrackResolution:
|
||||
def test_no_dimensions(self):
|
||||
assert VideoTrack(index=0, codec=None, width=None, height=None).resolution is None
|
||||
assert (
|
||||
VideoTrack(index=0, codec=None, width=None, height=None).resolution is None
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"w,expected",
|
||||
@@ -50,11 +53,16 @@ class TestVideoTrackResolution:
|
||||
],
|
||||
)
|
||||
def test_width_priority(self, w, expected):
|
||||
assert VideoTrack(index=0, codec=None, width=w, height=1080).resolution == expected
|
||||
assert (
|
||||
VideoTrack(index=0, codec=None, width=w, height=1080).resolution == expected
|
||||
)
|
||||
|
||||
def test_widescreen_scope_crop(self):
|
||||
# 1920x960 (scope crop) → still 1080p because width-priority
|
||||
assert VideoTrack(index=0, codec=None, width=1920, height=960).resolution == "1080p"
|
||||
assert (
|
||||
VideoTrack(index=0, codec=None, width=1920, height=960).resolution
|
||||
== "1080p"
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"h,expected",
|
||||
@@ -67,11 +75,15 @@ class TestVideoTrackResolution:
|
||||
],
|
||||
)
|
||||
def test_height_fallback_when_width_missing(self, h, expected):
|
||||
assert VideoTrack(index=0, codec=None, width=None, height=h).resolution == expected
|
||||
assert (
|
||||
VideoTrack(index=0, codec=None, width=None, height=h).resolution == expected
|
||||
)
|
||||
|
||||
def test_width_below_buckets_falls_to_height(self):
|
||||
# width=320 falls below every bucket; falls back to f"{h}p"
|
||||
assert VideoTrack(index=0, codec=None, width=320, height=240).resolution == "240p"
|
||||
assert (
|
||||
VideoTrack(index=0, codec=None, width=320, height=240).resolution == "240p"
|
||||
)
|
||||
|
||||
def test_width_only_below_buckets(self):
|
||||
# width=200, no height → f"{w}w" sentinel
|
||||
@@ -127,9 +139,7 @@ class TestAudioLanguages:
|
||||
assert m.audio_languages == []
|
||||
|
||||
def test_is_multi_audio_false_single_lang(self):
|
||||
m = MediaInfo(
|
||||
audio_tracks=[AudioTrack(0, "aac", 2, "stereo", "eng")]
|
||||
)
|
||||
m = MediaInfo(audio_tracks=[AudioTrack(0, "aac", 2, "stereo", "eng")])
|
||||
assert m.is_multi_audio is False
|
||||
|
||||
def test_is_multi_audio_true(self):
|
||||
|
||||
Reference in New Issue
Block a user