diff --git a/docs/riotwatcher/LeagueOfLegends/SpectatorApiV4.rst b/docs/riotwatcher/LeagueOfLegends/SpectatorApiV5.rst similarity index 89% rename from docs/riotwatcher/LeagueOfLegends/SpectatorApiV4.rst rename to docs/riotwatcher/LeagueOfLegends/SpectatorApiV5.rst index 41c2dc4..83a42cf 100644 --- a/docs/riotwatcher/LeagueOfLegends/SpectatorApiV4.rst +++ b/docs/riotwatcher/LeagueOfLegends/SpectatorApiV5.rst @@ -1,8 +1,8 @@ -SpectatorApiV4 +SpectatorApiV5 ============== .. py:currentmodule:: riotwatcher -.. autoclass:: riotwatcher._apis.league_of_legends.SpectatorApiV4 +.. autoclass:: riotwatcher._apis.league_of_legends.SpectatorApiV5 :members: :undoc-members: diff --git a/docs/riotwatcher/LeagueOfLegends/index.rst b/docs/riotwatcher/LeagueOfLegends/index.rst index cc3a25d..5d60786 100644 --- a/docs/riotwatcher/LeagueOfLegends/index.rst +++ b/docs/riotwatcher/LeagueOfLegends/index.rst @@ -23,5 +23,5 @@ All APIs LolStatusApiV4.rst MatchApiV5.rst ChallengesApiV1.rst - SpectatorApiV4.rst + SpectatorApiV5.rst SummonerApiV4.rst diff --git a/tests/_apis/league_of_legends/test_SpectatorApiV4.py b/tests/_apis/league_of_legends/test_SpectatorApiV5.py similarity index 70% rename from tests/_apis/league_of_legends/test_SpectatorApiV4.py rename to tests/_apis/league_of_legends/test_SpectatorApiV5.py index 3808723..0aa5c5f 100644 --- a/tests/_apis/league_of_legends/test_SpectatorApiV4.py +++ b/tests/_apis/league_of_legends/test_SpectatorApiV5.py @@ -2,28 +2,28 @@ import pytest -from riotwatcher._apis.league_of_legends import SpectatorApiV4 +from riotwatcher._apis.league_of_legends import SpectatorApiV5 @pytest.mark.lol @pytest.mark.unit -class TestSpectatorApiV4: +class TestSpectatorApiV5: def test_by_summoner(self): mock_base_api = MagicMock() expected_return = object() mock_base_api.raw_request.return_value = expected_return - spectator = SpectatorApiV4(mock_base_api) + spectator = SpectatorApiV5(mock_base_api) region = "agagd" - encrypted_summoner_id = "98532" + encrypted_puuid = "98532" - ret = spectator.by_summoner(region, encrypted_summoner_id) + ret = spectator.by_summoner(region, encrypted_puuid) mock_base_api.raw_request.assert_called_once_with( - SpectatorApiV4.__name__, + SpectatorApiV5.__name__, spectator.by_summoner.__name__, region, - f"https://{region}.api.riotgames.com/lol/spectator/v4/active-games/by-summoner/{encrypted_summoner_id}", + f"https://{region}.api.riotgames.com/lol/spectator/v5/active-games/by-summoner/{encrypted_puuid}", {}, ) @@ -34,16 +34,16 @@ def test_featured_games(self): expected_return = object() mock_base_api.raw_request.return_value = expected_return - spectator = SpectatorApiV4(mock_base_api) + spectator = SpectatorApiV5(mock_base_api) region = "hfh42" ret = spectator.featured_games(region) mock_base_api.raw_request.assert_called_once_with( - SpectatorApiV4.__name__, + SpectatorApiV5.__name__, spectator.featured_games.__name__, region, - f"https://{region}.api.riotgames.com/lol/spectator/v4/featured-games", + f"https://{region}.api.riotgames.com/lol/spectator/v5/featured-games", {}, ) diff --git a/tests/integration/league_of_legends/test_SpectatorApiV4.py b/tests/integration/league_of_legends/test_SpectatorApiV5.py similarity index 64% rename from tests/integration/league_of_legends/test_SpectatorApiV4.py rename to tests/integration/league_of_legends/test_SpectatorApiV5.py index 858b512..0a140d5 100644 --- a/tests/integration/league_of_legends/test_SpectatorApiV4.py +++ b/tests/integration/league_of_legends/test_SpectatorApiV5.py @@ -21,16 +21,16 @@ "pbe1", ], ) -class TestSpectatorApiV4: - @pytest.mark.parametrize("encrypted_summoner_id", ["12345", "99999999999999999"]) - def test_by_summoner(self, lol_context, region, encrypted_summoner_id): +class TestSpectatorApiV5: + @pytest.mark.parametrize("encrypted_puuid", ["12345", "99999999999999999"]) + def test_by_summoner(self, lol_context, region, encrypted_puuid): actual_response = lol_context.watcher.spectator.by_summoner( - region, encrypted_summoner_id + region, encrypted_puuid ) lol_context.verify_api_call( region, - f"/lol/spectator/v4/active-games/by-summoner/{encrypted_summoner_id}", + f"/lol/spectator/v5/active-games/by-summoner/{encrypted_puuid}", {}, actual_response, ) @@ -39,5 +39,5 @@ def test_featured_games(self, lol_context, region): actual_response = lol_context.watcher.spectator.featured_games(region) lol_context.verify_api_call( - region, "/lol/spectator/v4/featured-games", {}, actual_response + region, "/lol/spectator/v5/featured-games", {}, actual_response )