2024-01-04 17:26:16 +00:00
|
|
|
mod testutils;
|
|
|
|
use riven::consts::*;
|
2024-01-21 03:41:46 +00:00
|
|
|
use testutils::*;
|
2024-01-04 17:26:16 +00:00
|
|
|
|
|
|
|
const ROUTE: PlatformRoute = PlatformRoute::RU;
|
|
|
|
|
2024-02-24 17:28:33 +00:00
|
|
|
#[tokio_shared_rt::test]
|
|
|
|
async fn summoner_leagues() -> Result<(), String> {
|
|
|
|
let sum = RIOT_API
|
|
|
|
.summoner_v4()
|
|
|
|
.get_by_summoner_name(ROUTE, "d3atomiz3d");
|
|
|
|
let sum = sum
|
|
|
|
.await
|
|
|
|
.map_err(|e| format!("Error getting summoner: {}", e))?
|
|
|
|
.ok_or_else(|| "Failed to find summoner".to_owned())?;
|
2024-01-04 17:26:16 +00:00
|
|
|
|
2024-02-24 17:28:33 +00:00
|
|
|
let p = RIOT_API
|
|
|
|
.league_v4()
|
|
|
|
.get_league_entries_for_summoner(ROUTE, &sum.id);
|
|
|
|
let s = p
|
|
|
|
.await
|
|
|
|
.map_err(|e| format!("Error getting league entries: {}", e))?;
|
|
|
|
let _ = s;
|
|
|
|
Ok(())
|
2024-01-04 17:26:16 +00:00
|
|
|
}
|