add/update league-v4 tests

This commit is contained in:
Mingwei Samuel 2025-01-10 15:40:19 -08:00
parent 0885faefcf
commit cc2f419dfb

View file

@ -18,7 +18,35 @@ async fn champion_getrotation() -> Result<(), String> {
} }
#[riven_test] #[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( let p = riot_api().league_exp_v4().get_league_entries(
ROUTE, ROUTE,
QueueType::RANKED_SOLO_5x5, QueueType::RANKED_SOLO_5x5,
@ -27,9 +55,7 @@ async fn leagueexp_get() -> Result<(), String> {
None, None,
); );
let d = p.await.map_err(|e| e.to_string())?; let d = p.await.map_err(|e| e.to_string())?;
if d.is_empty() { assert!(!d.is_empty(), "Returns 204 (`None`) when empty.");
eprintln!("Off-season, challenger league is empty.");
}
Ok(()) Ok(())
} }