def test_create_post():
channel_id = '1234'
response = {
'post': example_post,
'tweet': None
}
responses.add(responses.POST,
'%sfeed/%s/posts' % (BASE_URL, channel_id),
body=json.dumps(response),
status=200,
content_type='application/json')
client = TwitchClient('client id', 'oauth token')
post = client.channel_feed.create_post(channel_id, 'abcd')
assert len(responses.calls) == 1
assert isinstance(post, Post)
assert post.id == example_post['id']
assert post.body == example_post['body']
评论列表
文章目录