def test_get_featured():
responses.add(responses.GET,
'%sstreams/featured' % BASE_URL,
body=json.dumps(example_featured_response),
status=200,
content_type='application/json')
client = TwitchClient('client id')
featured = client.streams.get_featured()
assert len(responses.calls) == 1
assert len(featured) == 1
feature = featured[0]
assert isinstance(feature, Featured)
assert feature.title == example_featured_response['featured'][0]['title']
stream = feature.stream
assert isinstance(stream, Stream)
assert stream.id == example_stream_response['stream']['_id']
assert stream.game == example_stream_response['stream']['game']
评论列表
文章目录