How to use the riotwatcher._apis.LeagueApiV3.__name__ 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_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