mirror of
https://github.com/ihabunek/twitch-dl
synced 2024-08-30 18:32:25 +00:00
Expand tests
This commit is contained in:
parent
98d2ce0bc7
commit
9cc7c05d8a
@ -36,15 +36,19 @@ def test_get_videos():
|
||||
|
||||
|
||||
def test_get_clips():
|
||||
"""
|
||||
This test depends on the channel having some videos published.
|
||||
"""
|
||||
clips = twitch.get_channel_clips(TEST_CHANNEL, "all_time", 3)
|
||||
assert clips["pageInfo"]
|
||||
assert len(clips["edges"]) > 0
|
||||
page = twitch.get_channel_clips(TEST_CHANNEL, "all_time", 3)
|
||||
assert len(page.clips) > 0
|
||||
|
||||
slug = clips["edges"][0]["node"]["slug"]
|
||||
slug = page.clips[0].slug
|
||||
clip = twitch.get_clip(slug)
|
||||
assert clip["slug"] == slug
|
||||
assert clip.slug == slug
|
||||
|
||||
assert get_clip_authenticated_url(slug, "source")
|
||||
assert get_clip_authenticated_url(slug, "source").startswith("https")
|
||||
|
||||
|
||||
def test_get_game():
|
||||
game_id = twitch.get_game_id("The Witness")
|
||||
assert game_id == "17324"
|
||||
|
||||
game_id = twitch.get_game_id("Does Not Exist Hoepfully")
|
||||
assert game_id is None
|
||||
|
5
tests/test_twitch.py
Normal file
5
tests/test_twitch.py
Normal file
@ -0,0 +1,5 @@
|
||||
from twitchdl.twitch import channel_clips_generator
|
||||
|
||||
|
||||
# def test_clips_generator():
|
||||
# channel_clips_generator("foo", "bar", 100)
|
Loading…
Reference in New Issue
Block a user