def test_get_top():
params = {'limit': 1, 'period': 'month'}
responses.add(
responses.GET,
'%sclips/top' % BASE_URL,
body=json.dumps(example_clips),
status=200,
content_type='application/json'
)
client = TwitchClient('client id')
clips = client.clips.get_top(**params)
assert len(clips) == len(example_clips)
assert isinstance(clips[0], Clip)
assert clips[0].broadcast_id == example_clips['clips'][0]['broadcast_id']
评论列表
文章目录