def test_get_top():
responses.add(responses.GET,
'%sgames/top' % BASE_URL,
body=json.dumps(example_top_games_response),
status=200,
content_type='application/json')
client = TwitchClient('abcd')
games = client.games.get_top()
assert len(responses.calls) == 1
assert len(games) == 1
assert isinstance(games[0], TopGame)
game = games[0].game
assert isinstance(game, Game)
assert game.id == example_top_games_response['top'][0]['game']['_id']
评论列表
文章目录