How to use the riotwatcher._apis.SpectatorApiV3 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_SpectatorApiV3.py View on Github external
def test_by_summoner(self):
        mock_base_api = MagicMock()
        expected_return = object()
        mock_base_api.raw_request.return_value = expected_return

        spectator = SpectatorApiV3(mock_base_api)
        region = "agagd"
        summoner_id = 98532

        ret = spectator.by_summoner(region, summoner_id)

        mock_base_api.raw_request.assert_called_once_with(
            SpectatorApiV3.__name__,
            spectator.by_summoner.__name__,
            region,
            "https://agagd.api.riotgames.com/lol/spectator/v3/active-games/by-summoner/{summonerId}".format(
                summonerId=summoner_id
            ),
            {},
        )

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

        spectator = SpectatorApiV3(mock_base_api)
        region = "hfh42"

        ret = spectator.featured_games(region)

        mock_base_api.raw_request.assert_called_once_with(
            SpectatorApiV3.__name__,
            spectator.featured_games.__name__,
            region,
            "https://hfh42.api.riotgames.com/lol/spectator/v3/featured-games",
            {},
        )

        assert ret is expected_return