update
Some checks failed
Tests / test (ubuntu-latest, 3.10) (push) Successful in 44s
Tests / test (ubuntu-latest, 3.8) (push) Failing after 4m3s
Tests / test (ubuntu-latest, 3.9) (push) Successful in 14m4s
Tests / test (macos-latest, 3.10) (push) Has been cancelled
Tests / test (macos-latest, 3.8) (push) Has been cancelled
Tests / test (macos-latest, 3.9) (push) Has been cancelled
Tests / test (windows-latest, 3.10) (push) Has been cancelled
Tests / test (windows-latest, 3.8) (push) Has been cancelled
Tests / test (windows-latest, 3.9) (push) Has been cancelled

This commit is contained in:
2025-03-13 11:20:16 -07:00
parent 48ef9a8e71
commit 58e8d92bc3
4 changed files with 13 additions and 76 deletions

View File

@@ -110,36 +110,6 @@ class TestParseFilename:
# Simple number in season directory
file_path = os.path.join("path", "to", "My Anime", "Season 2", "5.mkv")
title, season, episode = downloader.parse_filename(file_path)
# Mock _prompt_for_title_info to avoid reading from stdin for the entire test function
with patch.object(self.downloader, "_prompt_for_title_info") as mock_prompt:
# Configure mock to return appropriate values for different test cases
mock_prompt.side_effect = [
("Show Name", 1, 2), # First call return value
("Show Name", 3, 4), # Second call return value
("My Anime", 2, 5), # Third call return value
("Long Anime Title With Spaces", 1, 3), # Fourth call return value
]
# Standard Season-## format
title, season, episode = self.downloader.parse_filename(
"/path/to/Show Name/Season-1/Show Name - 02 [1080p].mkv"
)
assert title == "Show Name"
assert season == 1
assert episode == 2
# Season ## format
title, season, episode = self.downloader.parse_filename(
"/path/to/Show Name/Season 03/Episode 4.mkv"
)
assert title == "Show Name"
assert season == 3
assert episode == 4
# Simple number in season directory
title, season, episode = self.downloader.parse_filename(
"/path/to/My Anime/Season 2/5.mkv"
)
assert title == "My Anime"
assert season == 2
assert episode == 5
@@ -154,9 +124,6 @@ class TestParseFilename:
"Long Anime Title With Spaces - 03.mkv",
)
title, season, episode = downloader.parse_filename(file_path)
title, season, episode = self.downloader.parse_filename(
"/media/user/Anime/Long Anime Title With Spaces/Season-1/Long Anime Title With Spaces - 03.mkv"
)
assert title == "Long Anime Title With Spaces"
assert season == 1
assert episode == 3