Expand tests

This commit is contained in:
Ivan Habunek 2022-08-19 09:35:00 +02:00
parent cacf921923
commit 8e3a41e415
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95

View File

@ -2,7 +2,10 @@
These tests depend on the channel having some videos and clips published.
"""
import httpx
import m3u8
from twitchdl import twitch
from twitchdl.commands.download import _parse_playlists
TEST_CHANNEL = "bananasaurus_rex"
@ -16,6 +19,21 @@ def test_get_videos():
video = twitch.get_video(video_id)
assert video["id"] == video_id
access_token = twitch.get_access_token(video_id)
assert "signature" in access_token
assert "value" in access_token
playlists = twitch.get_playlists(video_id, access_token)
assert playlists.startswith("#EXTM3U")
name, res, url = next(_parse_playlists(playlists))
playlist = httpx.get(url).text
assert playlist.startswith("#EXTM3U")
playlist = m3u8.loads(playlist)
vod_path = playlist.segments[0].uri
assert vod_path == "0.ts"
def test_get_clips():
"""