How to use the riotwatcher._apis.LeagueApiV3 function in riotwatcher

To help you get started, we’ve selected a few riotwatcher examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pseudonym117 / Riot-Watcher / tests / _apis / test_LeagueApiV3.py View on Github external
def test_challenger_by_queue(self):
        mock_base_api = MagicMock()
        expected_return = object()
        mock_base_api.raw_request.return_value = expected_return

        league = LeagueApiV3(mock_base_api)
        region = "afas"
        queue = "yolo_q"

        ret = league.challenger_by_queue(region, queue)

        mock_base_api.raw_request.assert_called_once_with(
            LeagueApiV3.__name__,
            league.challenger_by_queue.__name__,
            region,
            "https://afas.api.riotgames.com/lol/league/v3/challengerleagues/by-queue/{queue}".format(
                queue=queue
            ),
            {},
        )

        assert ret is expected_return
github pseudonym117 / Riot-Watcher / tests / _apis / test_LeagueApiV3.py View on Github external
def test_positions_by_summoner(self):
        mock_base_api = MagicMock()
        expected_return = object()
        mock_base_api.raw_request.return_value = expected_return

        league = LeagueApiV3(mock_base_api)
        region = "afasf"
        summoner_id = 52343

        ret = league.positions_by_summoner(region, summoner_id)

        mock_base_api.raw_request.assert_called_once_with(
            LeagueApiV3.__name__,
            league.positions_by_summoner.__name__,
            region,
            "https://afasf.api.riotgames.com/lol/league/v3/positions/by-summoner/{summonerId}".format(
                summonerId=summoner_id
            ),
            {},
        )

        assert ret is expected_return
github pseudonym117 / Riot-Watcher / tests / _apis / test_LeagueApiV3.py View on Github external
def test_by_id(self):
        mock_base_api = MagicMock()
        expected_return = object()
        mock_base_api.raw_request.return_value = expected_return

        league = LeagueApiV3(mock_base_api)
        region = "afasf"
        league_id = "aaa-bbb-ccc"

        ret = league.by_id(region, league_id)

        mock_base_api.raw_request.assert_called_once_with(
            LeagueApiV3.__name__,
            league.by_id.__name__,
            region,
            "https://afasf.api.riotgames.com/lol/league/v3/leagues/{league_id}".format(
                league_id=league_id
            ),
            {},
        )

        assert ret is expected_return
github pseudonym117 / Riot-Watcher / tests / _apis / test_LeagueApiV3.py View on Github external
def test_masters_by_queue(self):
        mock_base_api = MagicMock()
        expected_return = object()
        mock_base_api.raw_request.return_value = expected_return

        league = LeagueApiV3(mock_base_api)
        region = "afasf"
        queue = "yolo_q"

        ret = league.masters_by_queue(region, queue)

        mock_base_api.raw_request.assert_called_once_with(
            LeagueApiV3.__name__,
            league.masters_by_queue.__name__,
            region,
            "https://afasf.api.riotgames.com/lol/league/v3/masterleagues/by-queue/{queue}".format(
                queue=queue
            ),
            {},
        )

        assert ret is expected_return