Expand tests

This commit is contained in:
Ivan Habunek 2022-08-27 11:58:19 +02:00
parent 98d2ce0bc7
commit 9cc7c05d8a
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D
2 changed files with 18 additions and 9 deletions

View File

@ -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
View File

@ -0,0 +1,5 @@
from twitchdl.twitch import channel_clips_generator
# def test_clips_generator():
# channel_clips_generator("foo", "bar", 100)