mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-27 03:16:33 +00:00
25 lines
678 B
Rust
25 lines
678 B
Rust
mod testutils;
|
|
|
|
use riven::consts::*;
|
|
use testutils::*;
|
|
|
|
const ROUTE: RegionalRoute = RegionalRoute::AMERICAS;
|
|
|
|
/// https://developer.riotgames.com/apis#account-v1/GET_getByAccessToken
|
|
#[riven_test]
|
|
async fn account_v1_getbyaccesstoken() -> Result<(), String> {
|
|
let Ok(access_token) = std::env::var("RGAPI_ACCESS_TOKEN") else {
|
|
eprintln!("`RGAPI_ACCESS_TOKEN` env var not set, cannot test RSO.");
|
|
return Ok(());
|
|
};
|
|
|
|
let account = riot_api()
|
|
.account_v1()
|
|
.get_by_access_token(ROUTE, access_token)
|
|
.await
|
|
.map_err(|e| format!("Failed to get account by riot ID: {}", e))?;
|
|
|
|
println!("{:#?}", account);
|
|
|
|
Ok(())
|
|
}
|