2021-06-30 23:34:34 +00:00
|
|
|
mod testutils;
|
2024-02-25 04:50:00 +00:00
|
|
|
use futures::future::join_all;
|
2021-06-30 23:34:34 +00:00
|
|
|
use riven::consts::*;
|
|
|
|
use riven::models::summoner_v4::Summoner;
|
2024-03-15 06:26:17 +00:00
|
|
|
use testutils::*;
|
2021-06-30 23:34:34 +00:00
|
|
|
|
|
|
|
const ROUTE: PlatformRoute = PlatformRoute::TR1;
|
|
|
|
|
2024-02-25 04:50:00 +00:00
|
|
|
#[riven_test]
|
2024-02-24 17:28:33 +00:00
|
|
|
async fn league_summoner_bulk_test() -> Result<(), String> {
|
2024-02-24 17:46:11 +00:00
|
|
|
let p = riot_api()
|
2024-02-24 17:28:33 +00:00
|
|
|
.league_v4()
|
|
|
|
.get_challenger_league(ROUTE, QueueType::RANKED_SOLO_5x5);
|
2024-02-25 04:50:00 +00:00
|
|
|
let league_list = p.await.map_err(|e| e.to_string())?;
|
2021-06-30 23:34:34 +00:00
|
|
|
|
2024-02-25 04:50:00 +00:00
|
|
|
println!(
|
|
|
|
"{:?} Challenger {} entries.",
|
|
|
|
ROUTE,
|
|
|
|
league_list.entries.len()
|
|
|
|
);
|
2021-06-30 23:34:34 +00:00
|
|
|
|
2024-02-25 04:50:00 +00:00
|
|
|
let summoner_vec = join_all(league_list.entries.iter().take(50).map(|entry| {
|
|
|
|
riot_api()
|
|
|
|
.summoner_v4()
|
|
|
|
.get_by_summoner_id(ROUTE, &entry.summoner_id)
|
|
|
|
}))
|
|
|
|
.await;
|
2021-06-30 23:34:34 +00:00
|
|
|
|
2024-02-25 04:50:00 +00:00
|
|
|
for (i, s) in summoner_vec.into_iter().enumerate() {
|
|
|
|
let summoner: Summoner = s.map_err(|e| e.to_string())?;
|
2024-02-24 17:28:33 +00:00
|
|
|
println!("{}: {}", i + 1, summoner.name);
|
2021-06-30 23:34:34 +00:00
|
|
|
}
|
2024-02-24 17:28:33 +00:00
|
|
|
|
|
|
|
Ok(())
|
2021-06-30 23:34:34 +00:00
|
|
|
}
|
2024-03-15 06:26:17 +00:00
|
|
|
|
|
|
|
#[riven_test]
|
|
|
|
async fn spectator_v5_combo_test() -> Result<(), String> {
|
|
|
|
spectator_v5_combo(ROUTE).await
|
|
|
|
}
|
|
|
|
|
|
|
|
#[riven_test]
|
|
|
|
async fn spectator_tft_v5_combo_test() -> Result<(), String> {
|
|
|
|
spectator_tft_v5_combo(ROUTE).await
|
|
|
|
}
|