def test_get_follows():
user_id = 1234
response = {
'_total': 27,
'follows': [example_follow]
}
responses.add(responses.GET,
'%susers/%s/follows/channels' % (BASE_URL, user_id),
body=json.dumps(response),
status=200,
content_type='application/json')
client = TwitchClient('client id')
follows = client.users.get_follows(user_id)
assert len(responses.calls) == 1
assert len(follows) == 1
follow = follows[0]
assert isinstance(follow, Follow)
assert follow.notifications == example_follow['notifications']
assert isinstance(follow.channel, Channel)
assert follow.channel.id == example_channel['_id']
assert follow.channel.name == example_channel['name']
评论列表
文章目录