Squash Odysseus development history

This commit is contained in:
pewdiepie-archdaemon
2026-09-11 06:04:19 +00:00
parent e5c99a5eee
commit 6ee6502010
2050 changed files with 538359 additions and 57745 deletions
@@ -0,0 +1,15 @@
from services.youtube.youtube_handler import extract_youtube_id
def test_extract_youtube_id_handles_non_string_url():
# urllib.parse.urlparse raises AttributeError on a non-string, so a non-str
# url (e.g. from a JSON-decoded request body) crashed the extractor instead
# of being treated as "not a YouTube URL".
assert extract_youtube_id(123) is None
assert extract_youtube_id({"bad": 1}) is None
assert extract_youtube_id(["https://youtu.be/x"]) is None
def test_extract_youtube_id_still_parses_real_urls():
assert extract_youtube_id("https://youtu.be/dQw4w9WgXcQ") == "dQw4w9WgXcQ"
assert extract_youtube_id("https://www.youtube.com/watch?v=abc123") == "abc123"