mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-27 03:16:33 +00:00
Update champion-master-v4 tests to use puuid
This commit is contained in:
parent
b4398e4e98
commit
13a06b224a
7 changed files with 7 additions and 7 deletions
|
@ -45,7 +45,7 @@ rt.block_on(async {
|
||||||
|
|
||||||
// Get champion mastery data.
|
// Get champion mastery data.
|
||||||
let masteries = riot_api.champion_mastery_v4()
|
let masteries = riot_api.champion_mastery_v4()
|
||||||
.get_all_champion_masteries(PlatformRoute::NA1, &summoner.id).await
|
.get_all_champion_masteries_by_puuid(PlatformRoute::NA1, &summoner.puuid).await
|
||||||
.expect("Get champion masteries failed.");
|
.expect("Get champion masteries failed.");
|
||||||
|
|
||||||
// Print champion masteries.
|
// Print champion masteries.
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
|
|
||||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||||
// Version a5a3a5f5d5f2a617a56302a0afac77c745e4fd56
|
// Version cd204d7d764a025c280943766bc498278e439a6c
|
||||||
|
|
||||||
//! Automatically generated endpoint handles.
|
//! Automatically generated endpoint handles.
|
||||||
#![allow(clippy::let_and_return, clippy::too_many_arguments)]
|
#![allow(clippy::let_and_return, clippy::too_many_arguments)]
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
//!
|
//!
|
||||||
//! // Get champion mastery data.
|
//! // Get champion mastery data.
|
||||||
//! let masteries = riot_api.champion_mastery_v4()
|
//! let masteries = riot_api.champion_mastery_v4()
|
||||||
//! .get_all_champion_masteries(PlatformRoute::NA1, &summoner.id).await
|
//! .get_all_champion_masteries_by_puuid(PlatformRoute::NA1, &summoner.puuid).await
|
||||||
//! .expect("Get champion masteries failed.");
|
//! .expect("Get champion masteries failed.");
|
||||||
//!
|
//!
|
||||||
//! // Print champion masteries.
|
//! // Print champion masteries.
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
|
|
||||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||||
// Version a5a3a5f5d5f2a617a56302a0afac77c745e4fd56
|
// Version cd204d7d764a025c280943766bc498278e439a6c
|
||||||
|
|
||||||
//! Metadata about the Riot API and Riven.
|
//! Metadata about the Riot API and Riven.
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
|
|
||||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||||
// Version a5a3a5f5d5f2a617a56302a0afac77c745e4fd56
|
// Version cd204d7d764a025c280943766bc498278e439a6c
|
||||||
|
|
||||||
#![allow(missing_docs)]
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ async_tests! {
|
||||||
.map_err(|e| format!("Error getting summoner: {}", e))?
|
.map_err(|e| format!("Error getting summoner: {}", e))?
|
||||||
.ok_or_else(|| "Failed to get summoner".to_owned())?;
|
.ok_or_else(|| "Failed to get summoner".to_owned())?;
|
||||||
|
|
||||||
let p = RIOT_API.champion_mastery_v4().get_all_champion_masteries(ROUTE, &sum.id);
|
let p = RIOT_API.champion_mastery_v4().get_all_champion_masteries_by_puuid(ROUTE, &sum.puuid);
|
||||||
let s = p.await.map_err(|e| format!("Error getting all champion masteries: {}", e))?;
|
let s = p.await.map_err(|e| format!("Error getting all champion masteries: {}", e))?;
|
||||||
rassert!(s.len() >= 142, "Expected masteries: {}.", s.len());
|
rassert!(s.len() >= 142, "Expected masteries: {}.", s.len());
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -57,7 +57,7 @@ async_tests! {
|
||||||
champion_mastery_v4: async {
|
champion_mastery_v4: async {
|
||||||
let summoner = RIOT_API.summoner_v4().get_by_summoner_name(ROUTE, "LugnutsK");
|
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 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 = RIOT_API.champion_mastery_v4().get_all_champion_masteries_by_puuid(ROUTE, &summoner.puuid);
|
||||||
let masteries = masteries.await.map_err(|e| e.to_string())?;
|
let masteries = masteries.await.map_err(|e| e.to_string())?;
|
||||||
rassert!(74 <= masteries.len());
|
rassert!(74 <= masteries.len());
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in a new issue