mirror of https://github.com/MingweiSamuel/Riven
test: remove `spectator-v4` tests
parent
f408e0f6bc
commit
513d9054af
|
@ -96,8 +96,6 @@ impl Notify {
|
|||
|
||||
#[cfg(all(test, not(target_family = "wasm")))]
|
||||
mod test {
|
||||
use futures::FutureExt;
|
||||
|
||||
use super::*;
|
||||
|
||||
#[tokio::test]
|
||||
|
|
|
@ -50,11 +50,6 @@ async fn championmastery_getall_ma5tery() -> Result<(), String> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[riven_test]
|
||||
async fn spectator_v4_combo_test() -> Result<(), String> {
|
||||
spectator_v4_combo(ROUTE).await
|
||||
}
|
||||
|
||||
#[riven_test]
|
||||
async fn spectator_v5_combo_test() -> Result<(), String> {
|
||||
spectator_v5_combo(ROUTE).await
|
||||
|
|
|
@ -34,11 +34,6 @@ async fn league_summoner_bulk_test() -> Result<(), String> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[riven_test]
|
||||
async fn spectator_v4_combo_test() -> Result<(), String> {
|
||||
spectator_v4_combo(ROUTE).await
|
||||
}
|
||||
|
||||
#[riven_test]
|
||||
async fn spectator_v5_combo_test() -> Result<(), String> {
|
||||
spectator_v5_combo(ROUTE).await
|
||||
|
|
|
@ -290,47 +290,6 @@ pub async fn match_v5_get_timeline(
|
|||
join_all_future_errs(futures).await
|
||||
}
|
||||
|
||||
pub async fn spectator_v4_combo(route: PlatformRoute) -> Result<(), String> {
|
||||
let featured_p = riot_api().spectator_v4().get_featured_games(route);
|
||||
let featured = featured_p.await.map_err(|e| e.to_string())?;
|
||||
|
||||
if featured.game_list.is_empty() {
|
||||
eprintln!("Featured game list is empty!");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let featured_game = &featured.game_list[0];
|
||||
let participant = &featured_game.participants[0];
|
||||
let summoner_id = participant.summoner_id.as_ref().ok_or_else(|| {
|
||||
format!(
|
||||
"Summoner in spectator featured game {} missing summoner ID: {}",
|
||||
featured_game.game_id, &participant.summoner_name,
|
||||
)
|
||||
})?;
|
||||
|
||||
let livegame_p = riot_api()
|
||||
.spectator_v4()
|
||||
.get_current_game_info_by_summoner(route, &summoner_id);
|
||||
let livegame_o = livegame_p.await.map_err(|e| {
|
||||
format!(
|
||||
"Failed to get live game {} for summoner ID {}: {}",
|
||||
featured_game.game_id, summoner_id, e,
|
||||
)
|
||||
})?;
|
||||
if let Some(livegame) = livegame_o {
|
||||
let participant_match = livegame
|
||||
.participants
|
||||
.iter()
|
||||
.find(|p| p.summoner_name == participant.summoner_name);
|
||||
rassert!(
|
||||
participant_match.is_some(),
|
||||
"Failed to find summoner in match: {}.",
|
||||
&participant.summoner_name
|
||||
);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn spectator_v5_combo(route: PlatformRoute) -> Result<(), String> {
|
||||
let featured_p = riot_api().spectator_v5().get_featured_games(route);
|
||||
let featured = featured_p.await.map_err(|e| e.to_string())?;
|
||||
|
|
Loading…
Reference in New Issue