Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_by_id(self):
mock_base_api = MagicMock()
expected_return = object()
mock_base_api.raw_request.return_value = expected_return
match = MatchApiV3(mock_base_api)
region = "afaaas"
match_id = 54321
ret = match.by_id(region, match_id)
mock_base_api.raw_request.assert_called_once_with(
MatchApiV3.__name__,
match.by_id.__name__,
region,
"https://afaaas.api.riotgames.com/lol/match/v3/matches/{matchId}".format(
matchId=match_id
),
{},
)
assert ret is expected_return
def test_timeline_by_match(self):
mock_base_api = MagicMock()
expected_return = object()
mock_base_api.raw_request.return_value = expected_return
match = MatchApiV3(mock_base_api)
region = "afaaas"
match_id = 262464
ret = match.timeline_by_match(region, match_id)
mock_base_api.raw_request.assert_called_once_with(
MatchApiV3.__name__,
match.timeline_by_match.__name__,
region,
"https://afaaas.api.riotgames.com/lol/match/v3/timelines/by-match/{matchId}".format(
matchId=match_id
),
{},
)
assert ret is expected_return
def test_ml_by_account_defaults(self):
mock_base_api = MagicMock()
expected_return = object()
mock_base_api.raw_request.return_value = expected_return
match = MatchApiV3(mock_base_api)
region = "sfsfa"
account_id = 15357
ret = match.matchlist_by_account(region, account_id)
mock_base_api.raw_request.assert_called_once_with(
MatchApiV3.__name__,
match.matchlist_by_account.__name__,
region,
"https://sfsfa.api.riotgames.com/lol/match/v3/matchlists/by-account/{accountId}".format(
accountId=account_id
),
{
"queue": None,
"beginTime": None,
"endTime": None,
def test_by_id(self):
mock_base_api = MagicMock()
expected_return = object()
mock_base_api.raw_request.return_value = expected_return
match = MatchApiV3(mock_base_api)
region = "afaaas"
match_id = 54321
ret = match.by_id(region, match_id)
mock_base_api.raw_request.assert_called_once_with(
MatchApiV3.__name__,
match.by_id.__name__,
region,
"https://afaaas.api.riotgames.com/lol/match/v3/matches/{matchId}".format(
matchId=match_id
),
{},
)
assert ret is expected_return
def test_ml_by_account_takes_param(self):
mock_base_api = MagicMock()
expected_return = object()
mock_base_api.raw_request.return_value = expected_return
match = MatchApiV3(mock_base_api)
region = "sfsfa"
account_id = 15357
queue = "dfdfdaaa"
begin_time, end_time = "sgshrhr", "sfsfsjjrj"
begin_index, end_index = "jtj3d", "3tn3ti"
season = "hg4reg422"
champion = "cancer"
ret = match.matchlist_by_account(
region,
account_id,
queue=queue,
begin_time=begin_time,
end_time=end_time,
begin_index=begin_index,