def test_get_by_id():
community_id = 'abcd'
responses.add(responses.GET,
'%scommunities/%s' % (BASE_URL, community_id),
body=json.dumps(example_community),
status=200,
content_type='application/json')
client = TwitchClient('client id')
community = client.communities.get_by_id(community_id)
assert len(responses.calls) == 1
assert isinstance(community, Community)
assert community.id == example_community['_id']
assert community.name == example_community['name']
评论列表
文章目录