Riven/tests/tests_tr.rs

33 lines
820 B
Rust
Raw Normal View History

2019-10-20 07:54:01 +00:00
#![feature(custom_test_frameworks)]
#![test_runner(my_runner)]
mod async_tests;
mod ids;
2019-10-20 07:54:01 +00:00
use colored::*;
use lazy_static::lazy_static;
use tokio::runtime::current_thread::Runtime;
use riven::RiotApi;
use riven::consts::*;
2019-10-20 07:54:01 +00:00
lazy_static! {
2019-10-22 05:43:06 +00:00
static ref RIOT_API: RiotApi = {
let api_key = std::fs::read_to_string("apikey.txt").unwrap();
2019-10-22 05:43:06 +00:00
RiotApi::with_key(api_key.trim())
2019-10-20 07:54:01 +00:00
};
}
async_tests!{
my_runner {
league_summoner_bulk_test: async {
let p = RIOT_API.league_v4().get_challenger_league(Region::TR, QueueType::RANKED_SOLO_5x5);
let ll = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get challenger league".to_owned())?;
// println!("{:#?}", ll);
// TODO!!!
2019-10-20 07:54:01 +00:00
Ok(())
},
}
}