dev: bump to 0.1.72-dev – Autoplay-Setting, Moflix Hoster-Dialog, Update-Hinweis im Hauptmenue
This commit is contained in:
@@ -374,50 +374,55 @@ def test_stream_link_for_movie_cache_miss(monkeypatch):
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Tests: _best_src_from_videos
|
||||
# Tests: _hosters_from_videos
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def test_best_src_prefers_vidara_over_fallback():
|
||||
def test_hosters_skips_gupload():
|
||||
plugin = MoflixPlugin()
|
||||
videos = [
|
||||
{"src": "https://moflix-stream.link/e/abc", "quality": "1080p"},
|
||||
{"src": "https://vidara.to/e/xyz789", "quality": "1080p"},
|
||||
{"src": "https://gupload.xyz/data/e/hash", "name": "GUpload"},
|
||||
{"src": "https://moflix-stream.link/e/abc", "name": "Mirror-HDCloud"},
|
||||
]
|
||||
assert plugin._best_src_from_videos(videos) == "https://vidara.to/e/xyz789"
|
||||
hosters = plugin._hosters_from_videos(videos)
|
||||
assert "https://gupload.xyz/data/e/hash" not in hosters.values()
|
||||
assert "https://moflix-stream.link/e/abc" in hosters.values()
|
||||
|
||||
|
||||
def test_best_src_skips_gupload():
|
||||
def test_hosters_skips_youtube():
|
||||
plugin = MoflixPlugin()
|
||||
videos = [
|
||||
{"src": "https://gupload.xyz/data/e/hash", "quality": "1080p"},
|
||||
{"src": "https://moflix-stream.link/e/abc", "quality": "1080p"},
|
||||
{"src": "https://youtube.com/watch?v=xyz", "name": "YouTube"},
|
||||
{"src": "https://vidara.to/e/real123", "name": "Vidara"},
|
||||
]
|
||||
# gupload übersprungen, moflix-stream.link als Fallback
|
||||
assert plugin._best_src_from_videos(videos) == "https://moflix-stream.link/e/abc"
|
||||
hosters = plugin._hosters_from_videos(videos)
|
||||
assert len(hosters) == 1
|
||||
assert "https://vidara.to/e/real123" in hosters.values()
|
||||
|
||||
|
||||
def test_best_src_skips_youtube():
|
||||
plugin = MoflixPlugin()
|
||||
videos = [
|
||||
{"src": "https://youtube.com/watch?v=xyz", "quality": None},
|
||||
{"src": "https://vidara.to/e/real123", "quality": "1080p"},
|
||||
]
|
||||
assert plugin._best_src_from_videos(videos) == "https://vidara.to/e/real123"
|
||||
|
||||
|
||||
def test_best_src_all_skipped_returns_none():
|
||||
def test_hosters_all_skipped_returns_empty():
|
||||
plugin = MoflixPlugin()
|
||||
videos = [
|
||||
{"src": "https://gupload.xyz/data/e/hash"},
|
||||
{"src": "https://youtube.com/watch?v=xyz"},
|
||||
]
|
||||
assert plugin._best_src_from_videos(videos) is None
|
||||
assert plugin._hosters_from_videos(videos) == {}
|
||||
|
||||
|
||||
def test_best_src_empty_returns_none():
|
||||
def test_hosters_empty_returns_empty():
|
||||
plugin = MoflixPlugin()
|
||||
assert plugin._best_src_from_videos([]) is None
|
||||
assert plugin._best_src_from_videos(None) is None # type: ignore[arg-type]
|
||||
assert plugin._hosters_from_videos([]) == {}
|
||||
|
||||
|
||||
def test_available_hosters_for_returns_names():
|
||||
plugin = MoflixPlugin()
|
||||
videos = [
|
||||
{"src": "https://vidara.to/e/xyz", "name": "Vidara-720"},
|
||||
{"src": "https://moflix-stream.click/e/abc", "name": "Mirror-HDCloud"},
|
||||
]
|
||||
# Mock _videos_for um direkt zu testen
|
||||
plugin._videos_for = lambda *a, **kw: videos # type: ignore[assignment]
|
||||
names = plugin.available_hosters_for("Test", "Film", "Test")
|
||||
assert len(names) == 2
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -472,7 +477,7 @@ def test_channel_empty_response_returns_empty(monkeypatch):
|
||||
plugin = MoflixPlugin()
|
||||
monkeypatch.setattr(plugin, "_get_json", lambda url, headers=None: None)
|
||||
assert plugin.popular_series() == []
|
||||
assert plugin.latest_titles() == []
|
||||
assert plugin.new_titles() == []
|
||||
|
||||
|
||||
def test_channel_malformed_response_returns_empty(monkeypatch):
|
||||
@@ -523,7 +528,7 @@ def test_capabilities():
|
||||
plugin = MoflixPlugin()
|
||||
caps = plugin.capabilities()
|
||||
assert "popular_series" in caps
|
||||
assert "latest_titles" in caps
|
||||
assert "new_titles" in caps
|
||||
assert "genres" in caps
|
||||
assert "collections" in caps
|
||||
|
||||
@@ -670,25 +675,26 @@ def test_resolve_stream_link_vidhide_fallback_on_failure(monkeypatch):
|
||||
# Tests: _best_src_from_videos – moflix-stream.click nicht mehr übersprungen
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def test_best_src_vidhide_not_skipped():
|
||||
def test_hosters_vidhide_not_skipped():
|
||||
"""moflix-stream.click ist nicht mehr in _VIDEO_SKIP_DOMAINS."""
|
||||
plugin = MoflixPlugin()
|
||||
videos = [
|
||||
{"src": "https://moflix-stream.click/embed/abc123", "quality": "1080p"},
|
||||
{"src": "https://moflix-stream.click/embed/abc123", "name": "Mirror-VidHide"},
|
||||
]
|
||||
result = plugin._best_src_from_videos(videos)
|
||||
assert result == "https://moflix-stream.click/embed/abc123"
|
||||
hosters = plugin._hosters_from_videos(videos)
|
||||
assert "https://moflix-stream.click/embed/abc123" in hosters.values()
|
||||
|
||||
|
||||
def test_best_src_vidara_preferred_over_vidhide():
|
||||
"""vidara.to hat Vorrang vor moflix-stream.click."""
|
||||
def test_hosters_vidara_present():
|
||||
"""vidara.to wird korrekt als Hoster erkannt."""
|
||||
plugin = MoflixPlugin()
|
||||
videos = [
|
||||
{"src": "https://moflix-stream.click/embed/abc123", "quality": "1080p"},
|
||||
{"src": "https://vidara.to/e/xyz789", "quality": "1080p"},
|
||||
{"src": "https://moflix-stream.click/embed/abc123", "name": "Mirror-VidHide"},
|
||||
{"src": "https://vidara.to/e/xyz789", "name": "Vidara-720"},
|
||||
]
|
||||
result = plugin._best_src_from_videos(videos)
|
||||
assert result == "https://vidara.to/e/xyz789"
|
||||
hosters = plugin._hosters_from_videos(videos)
|
||||
assert len(hosters) == 2
|
||||
assert "https://vidara.to/e/xyz789" in hosters.values()
|
||||
|
||||
|
||||
def test_stream_link_for_movie_vidhide_only(monkeypatch):
|
||||
|
||||
Reference in New Issue
Block a user