test: remove `spectator-v4` tests

val_queue
Mingwei Samuel 2024-04-08 12:09:30 -07:00
parent f408e0f6bc
commit 513d9054af
4 changed files with 0 additions and 53 deletions

View File

@ -96,8 +96,6 @@ impl Notify {
#[cfg(all(test, not(target_family = "wasm")))]
mod test {
use futures::FutureExt;
use super::*;
#[tokio::test]

View File

@ -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

View File

@ -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

View File

@ -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())?;