def test_parse_periscope_url_u(): pp = Peri() user_ids = [ '376827', ] for user_id in user_ids: url = 'https://www.periscope.tv/u/{user_id}'.format(user_id=user_id) assert pp.parse_periscope_url(url) == { 'username': None, 'user_id': user_id, 'broadcast_id': None, }
def test_parse_periscope_url_w(): pp = Peri() broadcast_ids = [ '1zqKVWybqeDGB', ] for broadcast_id in broadcast_ids: w_url = 'https://www.periscope.tv/w/{broadcast_id}'.format( broadcast_id=broadcast_id) assert pp.parse_periscope_url(w_url) == { 'broadcast_id': broadcast_id, 'user_id': None, 'username': None }
def test_parse_periscope_url_username(): pp = Peri() usernames = [ 'someusername', 'some_username', 'SomeUsername', ] for username in usernames: username_url = 'https://www.periscope.tv/{username}'.format( username=username) assert pp.parse_periscope_url(username_url) == { 'broadcast_id': None, 'user_id': None, 'username': username }
def test_parse_periscope_url_username_broadcast_id(): pp = Peri() usernames = [ 'someusername', 'some_username', 'SomeUsername', ] broadcast_ids = [ '1zqKVWybqeDGB', ] for username in usernames: for broadcast_id in broadcast_ids: username_url = 'https://www.periscope.tv/{username}/{broadcast_id}'.format( username=username, broadcast_id=broadcast_id, ) assert pp.parse_periscope_url(username_url) == { 'user_id': None, 'username': username, 'broadcast_id': broadcast_id, }