2019-11-07 20:45:13 +00:00
|
|
|
#![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
|
|
|
|
#![cfg_attr(feature = "nightly", test_runner(my_runner))]
|
2019-10-20 07:54:01 +00:00
|
|
|
|
|
|
|
mod async_tests;
|
2019-10-31 05:52:00 +00:00
|
|
|
mod testutils;
|
2019-12-31 05:35:23 +00:00
|
|
|
use testutils::RIOT_API;
|
2019-10-20 07:54:01 +00:00
|
|
|
|
|
|
|
use colored::*;
|
|
|
|
|
2019-10-30 20:24:07 +00:00
|
|
|
use riven::consts::*;
|
2019-11-03 18:48:45 +00:00
|
|
|
use riven::models::summoner_v4::Summoner;
|
2019-11-03 03:55:07 +00:00
|
|
|
|
2021-05-22 04:25:19 +00:00
|
|
|
const ROUTE: PlatformRoute = PlatformRoute::TR1;
|
2019-10-30 20:24:07 +00:00
|
|
|
|
|
|
|
|
2019-10-20 07:54:01 +00:00
|
|
|
async_tests!{
|
|
|
|
my_runner {
|
2019-10-30 20:24:07 +00:00
|
|
|
league_summoner_bulk_test: async {
|
2021-05-22 04:25:19 +00:00
|
|
|
let p = RIOT_API.league_v4().get_challenger_league(ROUTE, QueueType::RANKED_SOLO_5x5);
|
2019-11-03 03:55:07 +00:00
|
|
|
// let p = future_start(p);
|
2019-11-08 00:06:01 +00:00
|
|
|
let ll = p.await.map_err(|e| e.to_string())?;
|
2019-11-03 03:55:07 +00:00
|
|
|
|
2021-05-22 04:25:19 +00:00
|
|
|
println!("{:?} Challenger {} entries.", ROUTE, ll.entries.len());
|
2019-11-03 03:55:07 +00:00
|
|
|
|
2021-01-16 21:25:34 +00:00
|
|
|
let sl = ll.entries.iter().take(50)
|
2021-05-22 04:25:19 +00:00
|
|
|
.map(|entry| RIOT_API.summoner_v4().get_by_summoner_id(ROUTE, &entry.summoner_id))
|
2019-12-31 05:35:23 +00:00
|
|
|
.map(tokio::spawn)
|
2019-11-03 03:55:07 +00:00
|
|
|
.collect::<Vec<_>>();
|
|
|
|
|
|
|
|
for (i, s) in sl.into_iter().enumerate() {
|
2019-12-31 05:35:23 +00:00
|
|
|
let summoner: Summoner = s.await
|
|
|
|
.expect("tokio::spawn join error")
|
|
|
|
.map_err(|e| e.to_string())?;
|
2019-11-03 03:55:07 +00:00
|
|
|
println!("{}: {}", i + 1, summoner.name);
|
|
|
|
}
|
|
|
|
|
2019-10-20 07:54:01 +00:00
|
|
|
Ok(())
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|