def test_get_summary():
response = {
'channels': 1417,
'viewers': 19973
}
responses.add(responses.GET,
'%sstreams/summary' % BASE_URL,
body=json.dumps(response),
status=200,
content_type='application/json')
client = TwitchClient('client id')
summary = client.streams.get_summary()
assert len(responses.calls) == 1
assert isinstance(summary, dict)
assert summary['channels'] == response['channels']
assert summary['viewers'] == response['viewers']
评论列表
文章目录