From 50f1a4afdeb371a8c3de68bddc562b6d1e1051f3 Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Fri, 4 Jun 2021 20:14:07 -0700 Subject: [PATCH] Regen and add disabled AMERICAS test for new match-v5 --- src/endpoints.rs | 10 +++++----- src/meta.rs | 2 +- src/models.rs | 2 +- tests/tests_americas.rs | 24 ++++++++++++++++++++++++ tests/tests_na.rs | 3 ++- 5 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 tests/tests_americas.rs diff --git a/src/endpoints.rs b/src/endpoints.rs index 7b1d30f..3f58f33 100644 --- a/src/endpoints.rs +++ b/src/endpoints.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version 7938729f7e446a82eb73d3908205a579e3f0db71 +// Version 570eb12bfe9fb09e435976cb454f622293d0020e //! Automatically generated endpoint handles. @@ -949,10 +949,10 @@ impl<'a> MatchV5<'a> { /// /// Note: this method is automatically generated. pub fn get_match(&self, region: Region, match_id: &str) - -> impl Future> + 'a + -> impl Future>> + 'a { let path_string = format!("/lol/match/v5/matches/{}", match_id); - self.base.get::("match-v5.getMatch", region.into(), path_string, None) + self.base.get_optional::("match-v5.getMatch", region.into(), path_string, None) } /// Get a match timeline by match id @@ -964,10 +964,10 @@ impl<'a> MatchV5<'a> { /// /// Note: this method is automatically generated. pub fn get_timeline(&self, region: Region, match_id: &str) - -> impl Future> + 'a + -> impl Future>> + 'a { let path_string = format!("/lol/match/v5/matches/{}/timeline", match_id); - self.base.get::("match-v5.getTimeline", region.into(), path_string, None) + self.base.get_optional::("match-v5.getTimeline", region.into(), path_string, None) } } diff --git a/src/meta.rs b/src/meta.rs index 06caf7a..8a5cf42 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version 7938729f7e446a82eb73d3908205a579e3f0db71 +// Version 570eb12bfe9fb09e435976cb454f622293d0020e //! Metadata about the Riot API and Riven. //! diff --git a/src/models.rs b/src/models.rs index aef660c..0bf2bc7 100644 --- a/src/models.rs +++ b/src/models.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version 7938729f7e446a82eb73d3908205a579e3f0db71 +// Version 570eb12bfe9fb09e435976cb454f622293d0020e //! Data transfer structs. //! diff --git a/tests/tests_americas.rs b/tests/tests_americas.rs new file mode 100644 index 0000000..bd71bd2 --- /dev/null +++ b/tests/tests_americas.rs @@ -0,0 +1,24 @@ +#![cfg_attr(feature = "nightly", feature(custom_test_frameworks))] +#![cfg_attr(feature = "nightly", test_runner(my_runner))] + +mod async_tests; +mod testutils; +use testutils::*; + +use colored::*; + +// use riven::consts::*; + +async_tests!{ + my_runner { + // DISABLED FOR API KEY ACCESS. + // match_v5_get: async { + // let p = RIOT_API.match_v5().get_match(Region::AMERICAS, "NA1_3923487226"); + // let m = p.await.map_err(|e| e.to_string())?.ok_or("Match not found.".to_owned())?; + // rassert_eq!("NA1_3923487226", m.metadata.match_id, "Bad match id? {}", m.metadata.match_id); + // rassert!(!m.metadata.participants.is_empty(), "Match should have participants."); + // rassert!(!m.info.teams.is_empty(), "Match should have teams."); + // Ok(()) + // }, + } +} diff --git a/tests/tests_na.rs b/tests/tests_na.rs index eee3375..ffcfe0c 100644 --- a/tests/tests_na.rs +++ b/tests/tests_na.rs @@ -47,7 +47,6 @@ async_tests!{ }, matchlist_get: async { - let sp = RIOT_API.summoner_v4().get_by_summoner_name(Region::NA, "haha yes"); let s = sp.await.map_err(|e| e.to_string())?.ok_or("Failed to get \"haha yes\"".to_owned())?; let mp = RIOT_API.match_v4().get_matchlist(Region::NA, &s.account_id, None, Some(2500), None, None, Some(2600), None, None); @@ -117,6 +116,8 @@ async_tests!{ rassert!(!m.frames.is_empty(), "Match timeline should have frames."); Ok(()) }, + + // Commented out, requires special API key. // // LOR // lor_ranked_get_leaderboards: async {