-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀: merge pull request #33 from frissyn/dev
- Loading branch information
Showing
13 changed files
with
171 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import unittest | ||
|
||
if __name__ == "__main__": | ||
unittest.main("tests", exit=False, warnings=None) | ||
unittest.main("tests", exit=False, warnings=None, verbosity=5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .test_account import TestAccount | ||
from .test_content import TestContent | ||
from .test_ranked import TestRanked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import valorant | ||
|
||
from tests import BaseTest | ||
|
||
|
||
class TestRanked(BaseTest): | ||
def setUp(self): | ||
super().setUp() | ||
|
||
self.lb = self.client.get_leaderboard(10) | ||
self.iterator = self.client.get_leaderboard(pages=3, size=10) | ||
|
||
def test_leaderboard_attributes(self): | ||
for name in [ | ||
"actId", | ||
"players", | ||
"totalPlayers", | ||
"startIndex", | ||
"query", | ||
"shard", | ||
]: | ||
self.assertHasAttr(self.lb, name) | ||
|
||
def test_leaderboard_players(self): | ||
lb = self.client.get_leaderboard(10) | ||
|
||
for player in lb.players: | ||
for name in [ | ||
"gameName", | ||
"leaderboardRank", | ||
"numberOfWins", | ||
"puuid", | ||
"rankedRating", | ||
"tagLine", | ||
]: | ||
self.assertHasAttr(player, name) | ||
|
||
def test_leaderboard_iteration(self): | ||
for i in range(self.iterator.pages): | ||
next(self.iterator) | ||
|
||
with self.assertRaises(StopIteration): | ||
next(self.iterator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.