Migrate from Poetry and pyenv to uv
This commit is contained in:
+16
-7
@@ -1,4 +1,5 @@
|
||||
"""Tests for external subtitle sidecars (src.core.subtitles)."""
|
||||
|
||||
import pytest
|
||||
|
||||
from src.core.subtitles import (
|
||||
@@ -21,15 +22,21 @@ class TestSubtitleFilename:
|
||||
assert subtitle_filename("Matrix (1999)", ".srt") == "Matrix (1999).srt"
|
||||
|
||||
def test_with_language(self):
|
||||
assert subtitle_filename("Matrix (1999)", ".srt", "cs") == "Matrix (1999).cs.srt"
|
||||
assert (
|
||||
subtitle_filename("Matrix (1999)", ".srt", "cs") == "Matrix (1999).cs.srt"
|
||||
)
|
||||
|
||||
def test_with_language_and_flag(self):
|
||||
assert subtitle_filename("Matrix (1999)", ".srt", "cs", "forced") == \
|
||||
"Matrix (1999).cs.forced.srt"
|
||||
assert (
|
||||
subtitle_filename("Matrix (1999)", ".srt", "cs", "forced")
|
||||
== "Matrix (1999).cs.forced.srt"
|
||||
)
|
||||
|
||||
def test_uppercase_input_is_lowered(self):
|
||||
assert subtitle_filename("Matrix (1999)", ".SRT", "CS", "FORCED") == \
|
||||
"Matrix (1999).cs.forced.srt"
|
||||
assert (
|
||||
subtitle_filename("Matrix (1999)", ".SRT", "CS", "FORCED")
|
||||
== "Matrix (1999).cs.forced.srt"
|
||||
)
|
||||
|
||||
|
||||
class TestFindSubtitles:
|
||||
@@ -53,7 +60,7 @@ class TestFindSubtitles:
|
||||
def test_ignores_unrelated_and_overlapping_stem(self, tmp_path):
|
||||
video = _video(tmp_path, "Matrix.mkv")
|
||||
(tmp_path / "Matrix Reloaded.srt").write_bytes(b"x") # overlapping prefix
|
||||
(tmp_path / "Matrix.nfo").write_bytes(b"x") # not a subtitle ext
|
||||
(tmp_path / "Matrix.nfo").write_bytes(b"x") # not a subtitle ext
|
||||
(tmp_path / "poster.jpg").write_bytes(b"x")
|
||||
assert find_subtitles(video) == []
|
||||
|
||||
@@ -67,7 +74,9 @@ class TestFindSubtitles:
|
||||
|
||||
def test_label_property(self):
|
||||
assert SubtitleFile(path=None, language="cs").label == "cs"
|
||||
assert SubtitleFile(path=None, language="cs", flag="forced").label == "cs (forced)"
|
||||
assert (
|
||||
SubtitleFile(path=None, language="cs", flag="forced").label == "cs (forced)"
|
||||
)
|
||||
assert SubtitleFile(path=None).label == "?"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user