mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2025-01-24 09:47:26 -08:00
add/update league-v4 tests
This commit is contained in:
parent
0885faefcf
commit
cc2f419dfb
1 changed files with 30 additions and 4 deletions
|
@ -18,7 +18,35 @@ async fn champion_getrotation() -> Result<(), String> {
|
|||
}
|
||||
|
||||
#[riven_test]
|
||||
async fn leagueexp_get() -> Result<(), String> {
|
||||
async fn league_get_diamond() -> Result<(), String> {
|
||||
let p = riot_api().league_v4().get_league_entries(
|
||||
ROUTE,
|
||||
QueueType::RANKED_SOLO_5x5,
|
||||
Tier::DIAMOND,
|
||||
Division::IV,
|
||||
None,
|
||||
);
|
||||
let d = p.await.map_err(|e| e.to_string())?;
|
||||
if d.is_empty() {
|
||||
eprintln!("Diamond league is empty!");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[riven_test]
|
||||
async fn league_get_challenger() -> Result<(), String> {
|
||||
let p = riot_api()
|
||||
.league_v4()
|
||||
.get_challenger_league(ROUTE, QueueType::RANKED_SOLO_5x5);
|
||||
let d = p.await.map_err(|e| e.to_string())?;
|
||||
if d.entries.is_empty() {
|
||||
eprintln!("Off-season, challenger league is empty.");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[riven_test]
|
||||
async fn leagueexp_get_challenger() -> Result<(), String> {
|
||||
let p = riot_api().league_exp_v4().get_league_entries(
|
||||
ROUTE,
|
||||
QueueType::RANKED_SOLO_5x5,
|
||||
|
@ -27,9 +55,7 @@ async fn leagueexp_get() -> Result<(), String> {
|
|||
None,
|
||||
);
|
||||
let d = p.await.map_err(|e| e.to_string())?;
|
||||
if d.is_empty() {
|
||||
eprintln!("Off-season, challenger league is empty.");
|
||||
}
|
||||
assert!(!d.is_empty(), "Returns 204 (`None`) when empty.");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue