Add extra `champion-mastery-v4` test for user w/o new `puuid` field

pull/56/head
Mingwei Samuel 2023-05-15 08:53:23 -07:00
parent cb5bd58784
commit 4b3afbd8ab
1 changed files with 10 additions and 2 deletions

View File

@ -30,8 +30,8 @@ async_tests! {
summoner_double: async { summoner_double: async {
let l1p = RIOT_API.summoner_v4().get_by_summoner_name(ROUTE, "lug nuts k"); let l1p = RIOT_API.summoner_v4().get_by_summoner_name(ROUTE, "lug nuts k");
let l2p = RIOT_API.summoner_v4().get_by_summoner_name(ROUTE, "lugnuts k"); let l2p = RIOT_API.summoner_v4().get_by_summoner_name(ROUTE, "lugnuts k");
let l1 = l1p.await.map_err(|e| e.to_string())?.ok_or_else(|| "Failed to get l1".to_owned())?; let l1 = l1p.await.map_err(|e| e.to_string())?.ok_or_else(|| "'lug nuts k' not found!".to_owned())?;
let l2 = l2p.await.map_err(|e| e.to_string())?.ok_or_else(|| "Failed to get l2".to_owned())?; let l2 = l2p.await.map_err(|e| e.to_string())?.ok_or_else(|| "'lugnuts k' not found!".to_owned())?;
validate_summoners(l1, l2)?; validate_summoners(l1, l2)?;
Ok(()) Ok(())
}, },
@ -52,6 +52,14 @@ async_tests! {
rassert!(!d.is_empty(), "Challenger shouldn't be empty."); rassert!(!d.is_empty(), "Challenger shouldn't be empty.");
Ok(()) Ok(())
}, },
champion_mastery_v4: async {
let summoner = RIOT_API.summoner_v4().get_by_summoner_name(ROUTE, "LugnutsK");
let summoner = summoner.await.map_err(|e| e.to_string())?.ok_or_else(|| "'LugnutsK' not found!".to_owned())?;
let masteries = RIOT_API.champion_mastery_v4().get_all_champion_masteries(ROUTE, &summoner.id);
let masteries = masteries.await.map_err(|e| e.to_string())?;
rassert!(74 <= masteries.len());
Ok(())
},
// TO TEST THIS BUG: https://github.com/RiotGames/developer-relations/issues/572. // TO TEST THIS BUG: https://github.com/RiotGames/developer-relations/issues/572.
// https://lolchess.gg/leaderboards?mode=doubleup&region=na // https://lolchess.gg/leaderboards?mode=doubleup&region=na