Skip to content

Commit

Permalink
tests: updated bulk player test
Browse files Browse the repository at this point in the history
added "test_client" as a request parameter
added some missing tests for the player tests
  • Loading branch information
201st-Luka committed Sep 2, 2023
1 parent ac6185f commit 19877e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
12 changes: 7 additions & 5 deletions tests/bulk_requests/test_player_bulk.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@

@pytest.mark.asyncio
async def test_player_bulk(pyclasher_client):
player_bulk = await PlayerBulkRequest.from_clan(TEST_CLAN_TAG)
player_bulk = await PlayerBulkRequest.from_clan(TEST_CLAN_TAG,
"test_client")

assert isinstance(player_bulk.tags, Generator)
for tag in player_bulk.tags:
assert isinstance(tag, str)

await player_bulk.request()
await player_bulk.request("test_client")

assert isinstance(player_bulk.requests, list)
for player in player_bulk:
Expand All @@ -46,11 +47,12 @@ async def test_player_bulk(pyclasher_client):
assert isinstance(player.heroes, PlayerItemLevelList)
assert isinstance(player.labels, LabelList)
assert isinstance(player.league, (League, Missing))
assert isinstance(player.legend_statistics, PlayerLegendStatistics)
assert isinstance(player.player_house, PlayerHouse)
assert isinstance(player.legend_statistics,
(Missing, PlayerLegendStatistics))
assert isinstance(player.player_house, (Missing, PlayerHouse))
assert isinstance(player.spells, PlayerItemLevelList)
assert isinstance(player.town_hall_level, int)
assert isinstance(player.troops, PlayerItemLevelList)
assert isinstance(player.town_hall_weapon_level, int)
assert isinstance(player.town_hall_weapon_level, (Missing, int))
assert isinstance(player.versus_battle_wins, int)
assert isinstance(player.war_preference, WarPreference)
7 changes: 4 additions & 3 deletions tests/requests/test_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ async def test_player(event_loop, pyclasher_client):
assert isinstance(player.heroes, PlayerItemLevelList)
assert isinstance(player.labels, LabelList)
assert isinstance(player.league, (League, Missing))
assert isinstance(player.legend_statistics, PlayerLegendStatistics)
assert isinstance(player.player_house, PlayerHouse)
assert isinstance(player.legend_statistics, (Missing,
PlayerLegendStatistics))
assert isinstance(player.player_house, (Missing, PlayerHouse))
assert isinstance(player.spells, PlayerItemLevelList)
assert isinstance(player.town_hall_level, int)
assert isinstance(player.troops, PlayerItemLevelList)
assert isinstance(player.town_hall_weapon_level, int)
assert isinstance(player.town_hall_weapon_level, (Missing, int))
assert isinstance(player.versus_battle_wins, int)
assert isinstance(player.war_preference, WarPreference)

0 comments on commit 19877e4

Please sign in to comment.