Riven/riven/tests/tests_euw.rs

66 lines
1.8 KiB
Rust
Raw Normal View History

2021-06-30 23:34:34 +00:00
mod testutils;
use riven::consts::*;
2024-01-21 03:41:46 +00:00
use testutils::*;
2021-06-30 23:34:34 +00:00
const ROUTE: PlatformRoute = PlatformRoute::EUW1;
// Champion Mastery tests
2024-02-25 04:50:00 +00:00
#[riven_test]
async fn championmastery_getscore_ma5tery() -> Result<(), String> {
2024-04-24 05:55:16 +00:00
let account = riot_api()
.account_v1()
.get_by_riot_id(RegionalRoute::AMERICAS, "ma5tery", "EUW");
let account = account
.await
.map_err(|e| format!("Error getting summoner: {}", e))?
.ok_or_else(|| "Failed to find summoner".to_owned())?;
2021-06-30 23:34:34 +00:00
2024-04-24 05:55:16 +00:00
let masteries = riot_api()
.champion_mastery_v4()
2024-04-24 05:55:16 +00:00
.get_champion_mastery_score_by_puuid(ROUTE, &account.puuid);
let masteries = masteries
.await
.map_err(|e| format!("Error getting champion mastery score: {}", e))?;
rassert!(
2024-04-24 05:55:16 +00:00
(969..=1000).contains(&masteries),
"Unexpected ma5tery score: {}.",
2024-04-24 05:55:16 +00:00
masteries
);
Ok(())
}
2021-06-30 23:34:34 +00:00
2024-02-25 04:50:00 +00:00
#[riven_test]
async fn championmastery_getall_ma5tery() -> Result<(), String> {
2024-04-24 05:55:16 +00:00
let account = riot_api()
.account_v1()
.get_by_riot_id(RegionalRoute::AMERICAS, "ma5tery", "EUW");
let account = account
.await
.map_err(|e| format!("Error getting summoner: {}", e))?
.ok_or_else(|| "Failed to find summoner".to_owned())?;
2022-02-09 01:18:16 +00:00
2024-04-24 05:55:16 +00:00
let masteries = riot_api()
.champion_mastery_v4()
2024-04-24 05:55:16 +00:00
.get_all_champion_masteries_by_puuid(ROUTE, &account.puuid);
let masteries = masteries
.await
.map_err(|e| format!("Error getting all champion masteries: {}", e))?;
2024-04-24 05:55:16 +00:00
rassert!(
masteries.len() >= 142,
"Expected masteries: {}.",
masteries.len()
);
Ok(())
}
2022-02-09 01:18:16 +00:00
2024-03-04 23:04:11 +00:00
#[riven_test]
async fn spectator_v5_combo_test() -> Result<(), String> {
spectator_v5_combo(ROUTE).await
}
2024-03-04 23:04:11 +00:00
#[riven_test]
async fn spectator_tft_v5_combo_test() -> Result<(), String> {
spectator_tft_v5_combo(ROUTE).await
2024-03-04 23:04:11 +00:00
}