Skip to content

Commit

Permalink
tests: implemented test for ClanWarleaguesWarsRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
201st-Luka committed Aug 22, 2023
1 parent 412192b commit 6d3d51c
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion tests/requests/test_clan.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ClanRequest, ClanMembersRequest, Missing, ClanCurrentWarRequest,
ClanWarLogRequest, ClanSearchRequest, ClanCapitalRaidSeasonsRequest,
ClanCurrentwarLeaguegroupRequest,
RequestNotDone
RequestNotDone, ClanWarleaguesWarsRequest
)
from pyclasher.api.models import (
ClanType, WarFrequency, BadgeUrls, WarLeague, CapitalLeague, Language,
Expand Down Expand Up @@ -217,3 +217,27 @@ async def test_clan_currentwar_leaguegroup(event_loop, pyclasher_client):
assert isinstance(league_group.clans, ClanWarLeagueClanList)
assert isinstance(league_group.rounds, ClanWarLeagueRoundList)
assert isinstance(league_group.season, str)


@pytest.mark.asyncio
async def test_clan_warleagues_wars(event_loop, pyclasher_client):
try:
league_group = ClanCurrentwarLeaguegroupRequest(TEST_CLAN_TAG)

await league_group.request()
except RequestNotDone:
pass
else:
for league_round in league_group.rounds:
for war in league_round.war_tags:
group = ClanWarleaguesWarsRequest(war)

await group.request()

assert isinstance(group.to_dict(), dict)
assert group.war_tag == war

assert isinstance(group.state, ClanWarLeagueGroupState)
assert isinstance(group.clans, ClanWarLeagueClanList)
assert isinstance(group.rounds, ClanWarLeagueRoundList)
assert isinstance(group.season, str)

0 comments on commit 6d3d51c

Please sign in to comment.