From 513d9054aff4506cad05b32b59ef01ab821a0d64 Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Mon, 8 Apr 2024 12:09:30 -0700 Subject: [PATCH] test: remove `spectator-v4` tests --- riven/src/util/notify.rs | 2 -- riven/tests/tests_euw.rs | 5 ----- riven/tests/tests_tr.rs | 5 ----- riven/tests/testutils.rs | 41 ---------------------------------------- 4 files changed, 53 deletions(-) diff --git a/riven/src/util/notify.rs b/riven/src/util/notify.rs index 74734ec..fd28b7a 100644 --- a/riven/src/util/notify.rs +++ b/riven/src/util/notify.rs @@ -96,8 +96,6 @@ impl Notify { #[cfg(all(test, not(target_family = "wasm")))] mod test { - use futures::FutureExt; - use super::*; #[tokio::test] diff --git a/riven/tests/tests_euw.rs b/riven/tests/tests_euw.rs index 9dccf5e..aeccf02 100644 --- a/riven/tests/tests_euw.rs +++ b/riven/tests/tests_euw.rs @@ -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 diff --git a/riven/tests/tests_tr.rs b/riven/tests/tests_tr.rs index c0d7d01..2e6c289 100644 --- a/riven/tests/tests_tr.rs +++ b/riven/tests/tests_tr.rs @@ -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 diff --git a/riven/tests/testutils.rs b/riven/tests/testutils.rs index be83905..9eeb1c2 100644 --- a/riven/tests/testutils.rs +++ b/riven/tests/testutils.rs @@ -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())?;