4d280b5239
- Added new video players: Vidzy, LuLuvid, Uqload - Added new anime site: French-Manga - Added new series sites category with FS7 - Updated documentation to reflect three-tier architecture (anime sites → series sites → video players) - Added BaseSeriesSite interface documentation - Added "Adding New Series Site" section - Updated test organization with test_french_manga.py Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
93 lines
3.9 KiB
Python
93 lines
3.9 KiB
Python
"""Tests for French-Manga integration"""
|
|
import pytest
|
|
from app.downloaders.video_players import VidzyDownloader, LuLuvidDownloader
|
|
from app.downloaders.anime_sites import FrenchMangaDownloader
|
|
from app.downloaders import get_downloader
|
|
from app.providers import detect_provider_from_url
|
|
|
|
|
|
class TestVidzyDownloader:
|
|
"""Tests for Vidzy video player downloader"""
|
|
|
|
def test_can_handle_vidzy_urls(self):
|
|
"""Test that Vidzy downloader correctly identifies Vidzy URLs"""
|
|
downloader = VidzyDownloader()
|
|
|
|
assert downloader.can_handle("https://vidzy.com/v/abc123") == True
|
|
assert downloader.can_handle("https://www.vidzy.com/embed/xyz") == True
|
|
assert downloader.can_handle("http://vidzy.net/video/test") == True
|
|
assert downloader.can_handle("https://doodstream.com/test") == False
|
|
assert downloader.can_handle("https://vidmoly.to/test") == False
|
|
|
|
|
|
class TestLuLuvidDownloader:
|
|
"""Tests for LuLuvid video player downloader"""
|
|
|
|
def test_can_handle_luluv_urls(self):
|
|
"""Test that LuLuvid downloader correctly identifies LuLuvid URLs"""
|
|
downloader = LuLuvidDownloader()
|
|
|
|
assert downloader.can_handle("https://luluv.com/v/abc123") == True
|
|
assert downloader.can_handle("https://www.luluv.com/embed/xyz") == True
|
|
assert downloader.can_handle("https://luluvid.com/video/test") == True
|
|
assert downloader.can_handle("https://doodstream.com/test") == False
|
|
assert downloader.can_handle("https://vidmoly.to/test") == False
|
|
|
|
|
|
class TestFrenchMangaDownloader:
|
|
"""Tests for French-Manga anime site downloader"""
|
|
|
|
def test_can_handle_french_manga_urls(self):
|
|
"""Test that French-Manga downloader correctly identifies French-Manga URLs"""
|
|
downloader = FrenchMangaDownloader()
|
|
|
|
assert downloader.can_handle("https://french-manga.net/test.html") == True
|
|
assert downloader.can_handle("https://w16.french-manga.net/anime-test") == True
|
|
assert downloader.can_handle("https://www.french-manga.net/test") == True
|
|
assert downloader.can_handle("https://anime-sama.si/test") == False
|
|
assert downloader.can_handle("https://neko-sama.fr/test") == False
|
|
|
|
def test_initialization(self):
|
|
"""Test that FrenchMangaDownloader initializes correctly"""
|
|
downloader = FrenchMangaDownloader()
|
|
assert downloader.base_url == "https://w16.french-manga.net"
|
|
assert downloader.client is not None
|
|
|
|
|
|
class TestProviderDetection:
|
|
"""Tests for provider detection from URLs"""
|
|
|
|
def test_detect_french_manga_provider(self):
|
|
"""Test detection of French-Manga provider"""
|
|
provider = detect_provider_from_url("https://french-manga.net/anime-test.html")
|
|
assert provider == "french-manga"
|
|
|
|
def test_detect_vidzy_provider(self):
|
|
"""Test detection of Vidzy provider"""
|
|
provider = detect_provider_from_url("https://vidzy.com/v/test123")
|
|
assert provider == "vidzy"
|
|
|
|
def test_detect_luluv_provider(self):
|
|
"""Test detection of LuLuvid provider"""
|
|
provider = detect_provider_from_url("https://luluv.com/v/test123")
|
|
assert provider == "luluv"
|
|
|
|
|
|
class TestFactoryIntegration:
|
|
"""Tests for factory function integration"""
|
|
|
|
def test_french_manga_factory(self):
|
|
"""Test that factory returns FrenchMangaDownloader for French-Manga URLs"""
|
|
downloader = get_downloader("https://french-manga.net/test.html")
|
|
assert isinstance(downloader, FrenchMangaDownloader)
|
|
|
|
def test_vidzy_factory(self):
|
|
"""Test that factory returns VidzyDownloader for Vidzy URLs"""
|
|
downloader = get_downloader("https://vidzy.com/v/test123")
|
|
assert isinstance(downloader, VidzyDownloader)
|
|
|
|
def test_luluv_factory(self):
|
|
"""Test that factory returns LuLuvidDownloader for LuLuvid URLs"""
|
|
downloader = get_downloader("https://luluv.com/v/test123")
|
|
assert isinstance(downloader, LuLuvidDownloader)
|