forked from mirror/Riven
1
0
Fork 0

Release 2.5.1

users/mingwei/unknown-variant-messy
Mingwei Samuel 2022-02-08 17:18:16 -08:00
parent 1d70c479cf
commit 62f323da88
2 changed files with 20 additions and 17 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "riven"
version = "2.5.0"
version = "2.5.1"
authors = ["Mingwei Samuel <mingwei.samuel@gmail.com>"]
repository = "https://github.com/MingweiSamuel/Riven"
description = "Riot Games API Library"
@ -32,7 +32,7 @@ rustls-tls = [ "reqwest/rustls-tls" ]
lazy_static = "1.4"
log = "0.4"
num_enum = "0.5"
parking_lot = "0.11"
parking_lot = "0.12"
reqwest = { version = "0.11", default-features = false, features = [ "gzip", "json" ] }
scan_fmt = { version = "0.2", default-features = false }
serde = { version = "1.0", features = [ "derive" ] }

View File

@ -32,24 +32,27 @@ async_tests!{
rassert!(s.len() >= 142, "Expected masteries: {}.", s.len());
Ok(())
},
spectator_combo: async {
let featured_p = RIOT_API.spectator_v4().get_featured_games(ROUTE);
let featured = featured_p.await.map_err(|e| e.to_string())?;
rassert!(!featured.game_list.is_empty());
// TODO: https://github.com/RiotGames/developer-relations/issues/602
// spectator_combo: async {
// let featured_p = RIOT_API.spectator_v4().get_featured_games(ROUTE);
// let featured = featured_p.await.map_err(|e| e.to_string())?;
let summoner_name = &featured.game_list[0].participants[0].summoner_name;
let summoner_p = RIOT_API.summoner_v4().get_by_summoner_name(ROUTE, summoner_name);
let summoner = summoner_p.await.map_err(|e| e.to_string())?.ok_or_else(|| "Failed to get summoner".to_owned())?;
// rassert!(!featured.game_list.is_empty());
// let summoner_name = &featured.game_list[0].participants[0].summoner_name;
// let summoner_p = RIOT_API.summoner_v4().get_by_summoner_name(ROUTE, summoner_name);
// let summoner = summoner_p.await.map_err(|e| e.to_string())?.ok_or_else(|| "Failed to get summoner".to_owned())?;
// 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| e.to_string())?;
// if let Some(livegame) = livegame_o {
// let participant_match = livegame.participants.iter().find(|p| p.summoner_name == *summoner_name);
// rassert!(participant_match.is_some(), "Failed to find summoner in match: {}.", summoner_name);
// }
// Ok(())
// },
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| e.to_string())?;
if let Some(livegame) = livegame_o {
let participant_match = livegame.participants.iter().find(|p| p.summoner_name == *summoner_name);
rassert!(participant_match.is_some(), "Failed to find summoner in match: {}.", summoner_name);
}
Ok(())
},
// // TFT tests.
// tftleaguev1_getchallengerleague: async {
// let p = RIOT_API.tft_league_v1().get_challenger_league(Region::EUW);