def test_start_commercial():
channel_id = example_channel['_id']
response = {
'duration': 30,
'message': '',
'retryafter': 480
}
responses.add(responses.POST,
'%schannels/%s/commercial' % (BASE_URL, channel_id),
body=json.dumps(response),
status=200,
content_type='application/json')
client = TwitchClient('client id', 'oauth token')
commercial = client.channels.start_commercial(channel_id)
assert len(responses.calls) == 1
assert isinstance(commercial, dict)
assert commercial['duration'] == response['duration']
评论列表
文章目录