diff --git a/CHANGELOG.md b/CHANGELOG.md index eb9a868..3bdbfb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog All notable changes to this project will be documented in this file. +## 15/09/2020 + +### Added +- OfficialAPI: Added `get_clan_river_race` and `get_clan_river_race_log` + ## 09/11/2019 ### Fixed diff --git a/clashroyale/official_api/client.py b/clashroyale/official_api/client.py index 2070c70..6e96dc0 100644 --- a/clashroyale/official_api/client.py +++ b/clashroyale/official_api/client.py @@ -244,7 +244,7 @@ def get_player(self, tag: crtag, timeout=None): Parameters ---------- tag: str - A valid tournament tag. Minimum length: 3 + A valid player tag. Minimum length: 3 Valid characters: 0289PYLQGRJCUV timeout: Optional[int] = None Custom timeout that overwrites Client.timeout @@ -263,7 +263,7 @@ def get_player_verify(self, tag: crtag, apikey: str, timeout=None): Parameters ---------- tag: str - A valid tournament tag. Minimum length: 3 + A valid player tag. Minimum length: 3 Valid characters: 0289PYLQGRJCUV apikey: str The API Key in the player's settings @@ -280,7 +280,7 @@ def get_player_battles(self, tag: crtag, **params: keys): Parameters ---------- tag: str - A valid tournament tag. Minimum length: 3 + A valid player tag. Minimum length: 3 Valid characters: 0289PYLQGRJCUV \*\*limit: Optional[int] = None Limit the number of items returned in the response @@ -297,7 +297,7 @@ def get_player_chests(self, tag: crtag, timeout: int=None): Parameters ---------- tag: str - A valid tournament tag. Minimum length: 3 + A valid player tag. Minimum length: 3 Valid characters: 0289PYLQGRJCUV timeout: Optional[int] = None Custom timeout that overwrites Client.timeout @@ -312,7 +312,7 @@ def get_clan(self, tag: crtag, timeout: int=None): Parameters ---------- tag: str - A valid tournament tag. Minimum length: 3 + A valid clan tag. Minimum length: 3 Valid characters: 0289PYLQGRJCUV timeout: Optional[int] = None Custom timeout that overwrites Client.timeout @@ -350,18 +350,18 @@ def search_clans(self, **params: clansearch): return self._get_model(url, PartialClan, **params) @typecasted - def get_clan_war(self, tag: crtag, timeout: int=None): - """Get inforamtion about a clan's current clan war + def get_clan_river_race(self, tag: crtag, timeout: int = None): + """Get inforamtion about a clan's current river race Parameters ---------- tag: str - A valid tournament tag. Minimum length: 3 + A valid clan tag. Minimum length: 3 Valid characters: 0289PYLQGRJCUV timeout: Optional[int] = None Custom timeout that overwrites Client.timeout """ - url = self.api.CLAN + '/' + tag + '/currentwar' + url = self.api.CLAN + '/' + tag + '/currentriverrace' return self._get_model(url, timeout=timeout) @typecasted @@ -371,7 +371,7 @@ def get_clan_members(self, tag: crtag, **params: keys): Parameters ---------- tag: str - A valid tournament tag. Minimum length: 3 + A valid clan tag. Minimum length: 3 Valid characters: 0289PYLQGRJCUV \*\*limit: Optional[int] = None Limit the number of items returned in the response @@ -388,7 +388,7 @@ def get_clan_war_log(self, tag: crtag, **params: keys): Parameters ---------- tag: str - A valid tournament tag. Minimum length: 3 + A valid clan tag. Minimum length: 3 Valid characters: 0289PYLQGRJCUV \*\*limit: Optional[int] = None Limit the number of items returned in the response @@ -398,6 +398,23 @@ def get_clan_war_log(self, tag: crtag, **params: keys): url = self.api.CLAN + '/' + tag + '/warlog' return self._get_model(url, **params) + @typecasted + def get_clan_river_race_log(self, tag: crtag, **params: keys): + """Get a clan's river race log + + Parameters + ---------- + tag: str + A valid clan tag. Minimum length: 3 + Valid characters: 0289PYLQGRJCUV + \*\*limit: Optional[int] = None + Limit the number of items returned in the response + \*\*timeout: Optional[int] = None + Custom timeout that overwrites Client.timeout + """ + url = self.api.CLAN + '/' + tag + '/riverracelog' + return self._get_model(url, **params) + @typecasted def get_tournament(self, tag: crtag, timeout=0): """Get a tournament information diff --git a/tests/official_api/test_async.py b/tests/official_api/test_async.py index 07ef986..8cbcaad 100644 --- a/tests/official_api/test_async.py +++ b/tests/official_api/test_async.py @@ -79,8 +79,8 @@ async def test_search_clans_all_data(self): await clans.all_data() self.assertGreater(len(clans), 3) - async def test_get_clan_war(self): - clan = await self.cr.get_clan_war(self.clan_tags[0]) + async def test_get_clan_river_race(self): + clan = await self.cr.get_clan_river_race(self.clan_tags[0]) self.assertTrue(isinstance(clan.state, str)) async def test_get_clan_war_timeout(self): @@ -99,6 +99,10 @@ async def test_get_clan_war_log(self): clan = await self.cr.get_clan_war_log(self.clan_tags[0]) self.assertTrue(isinstance(clan, clashroyale.official_api.PaginatedAttrDict)) + async def test_get_clan_river_race_log(self): + clan = await self.cr.get_clan_river_race_log(self.clan_tags[0]) + self.assertTrue(isinstance(clan, clashroyale.official_api.PaginatedAttrDict)) + async def test_get_clan_war_log_timeout(self): clan = await self.cr.get_clan_war_log(self.clan_tags[1], timeout=100) self.assertTrue(isinstance(clan, clashroyale.official_api.PaginatedAttrDict)) diff --git a/tests/official_api/test_blocking.py b/tests/official_api/test_blocking.py index 1614bcb..a2f8978 100644 --- a/tests/official_api/test_blocking.py +++ b/tests/official_api/test_blocking.py @@ -82,8 +82,8 @@ def test_search_clans_all_data(self): clans.all_data() self.assertGreater(len(clans), 3) - def test_get_clan_war(self): - clan = self.cr.get_clan_war(self.clan_tags[0]) + def test_get_clan_river_race(self): + clan = self.cr.get_clan_river_race(self.clan_tags[0]) self.assertTrue(isinstance(clan.state, str)) def test_get_clan_war_timeout(self): @@ -102,6 +102,10 @@ def test_get_clan_war_log(self): clan = self.cr.get_clan_war_log(self.clan_tags[0]) self.assertTrue(isinstance(clan, clashroyale.official_api.PaginatedAttrDict)) + def test_get_clan_river_race_log(self): + clan = self.cr.get_clan_river_race_log(self.clan_tags[0]) + self.assertTrue(isinstance(clan, clashroyale.official_api.PaginatedAttrDict)) + def test_get_clan_war_log_timeout(self): clan = self.cr.get_clan_war_log(self.clan_tags[1], timeout=100) self.assertTrue(isinstance(clan, clashroyale.official_api.PaginatedAttrDict))