Skip to content

Commit

Permalink
correct tests since archived video urls seem to move
Browse files Browse the repository at this point in the history
  • Loading branch information
ingwinlu committed Mar 9, 2015
1 parent 9366254 commit fe3cfda
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_twitchtv.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def test_following_videos(self):

def test_video_playlist_c_chunked(self):
videoid = 'c5928479'
'''
temporary solution, twitch moves the archived flv's to different servers
expected_playlist = [
('', ('', 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-613890547-320x240.jpg')),
('http://media-cdn.twitch.tv/store24.media78/archives/2015-1-20/live_user_cobaltstreak_1421794812.flv', ('Resident Evil 1 HD Remaster - Part One - Part 1 of 13', 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-613890547-320x240.jpg')),
Expand All @@ -86,8 +88,9 @@ def test_video_playlist_c_chunked(self):
('http://media-cdn.twitch.tv/store91.media67/archives/2015-1-21/live_user_cobaltstreak_1421813631.flv', ('Resident Evil 1 HD Remaster - Part One - Part 12 of 13', 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-613890547-320x240.jpg')),
('http://media-cdn.twitch.tv/store82.media62/archives/2015-1-21/live_user_cobaltstreak_1421815341.flv', ('Resident Evil 1 HD Remaster - Part One - Part 13 of 13', 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-613890547-320x240.jpg'))
]
'''
playlist = self.twitch.getVideoPlaylist(videoid, 0)
self.assertEqual(playlist, expected_playlist)
self.assertEqual(len(playlist), 14)

def test_video_playlist_v_vod(self):
videoid = 'v3709509'
Expand All @@ -96,6 +99,8 @@ def test_video_playlist_v_vod(self):

def test_video_playlist_a_archived(self):
videoid = 'a619273813'
'''
temporary solution, twitch moves the archived flv's to different servers
expected_playlist = [
('', ('', 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-619273813-320x240.jpg')),
('http://media-cdn.twitch.tv/store155.media102/archives/2015-2-1/live_user_cobaltstreak_1422831905.flv', ('Darkest Dungeon - Early Access. Must kill more BOSSES! - Part 1 of 13', 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-619273813-320x240.jpg')),
Expand All @@ -112,8 +117,9 @@ def test_video_playlist_a_archived(self):
('http://media-cdn.twitch.tv/store107.media70/archives/2015-2-2/live_user_cobaltstreak_1422850728.flv', ('Darkest Dungeon - Early Access. Must kill more BOSSES! - Part 12 of 13', 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-619273813-320x240.jpg')),
('http://media-cdn.twitch.tv/store57.media71/archives/2015-2-2/live_user_cobaltstreak_1422852440.flv', ('Darkest Dungeon - Early Access. Must kill more BOSSES! - Part 13 of 13', 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-619273813-320x240.jpg'))
]
'''
playlist = self.twitch.getVideoPlaylist(videoid, 0)
self.assertEqual(playlist, expected_playlist)
self.assertEqual(len(playlist), 14)

def test_followed_games(self):
expected = [{'box': {'large': 'http://static-cdn.jtvnw.net/ttv-boxart/Counter-Strike:%20Global%20Offensive-272x380.jpg', 'small': 'http://static-cdn.jtvnw.net/ttv-boxart/Counter-Strike:%20Global%20Offensive-52x72.jpg', 'medium': 'http://static-cdn.jtvnw.net/ttv-boxart/Counter-Strike:%20Global%20Offensive-136x190.jpg', 'template': 'http://static-cdn.jtvnw.net/ttv-boxart/Counter-Strike:%20Global%20Offensive-{width}x{height}.jpg'}, 'giantbomb_id': 36113, 'name': 'Counter-Strike: Global Offensive', '_links': {}, 'logo': {'large': 'http://static-cdn.jtvnw.net/ttv-logoart/Counter-Strike:%20Global%20Offensive-240x144.jpg', 'small': 'http://static-cdn.jtvnw.net/ttv-logoart/Counter-Strike:%20Global%20Offensive-60x36.jpg', 'medium': 'http://static-cdn.jtvnw.net/ttv-logoart/Counter-Strike:%20Global%20Offensive-120x72.jpg', 'template': 'http://static-cdn.jtvnw.net/ttv-logoart/Counter-Strike:%20Global%20Offensive-{width}x{height}.jpg'}, '_id': 32399, 'properties': {}}]
Expand Down

0 comments on commit fe3cfda

Please sign in to comment.