From 5a78205dcde176bf0ee2cf7c422e9a25f1ebd470 Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Sun, 2 Aug 2020 20:31:24 -0700 Subject: [PATCH] Add tutorial tests, regen for optional match-v4.TeamStatsDto.win --- src/endpoints.rs | 2 +- src/meta.rs | 2 +- src/models.rs | 4 ++-- tests/tests_na.rs | 18 ++++++++++++++++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/endpoints.rs b/src/endpoints.rs index b4b4b18..c9d1952 100644 --- a/src/endpoints.rs +++ b/src/endpoints.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version ae788d19c63d356f53849f87be4d4b49b01c11de +// Version 36871d82bfc1f861d45c3941b4b5fddd3ab20ea0 //! Automatically generated endpoint handles. diff --git a/src/meta.rs b/src/meta.rs index 637a968..53b56b0 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version ae788d19c63d356f53849f87be4d4b49b01c11de +// Version 36871d82bfc1f861d45c3941b4b5fddd3ab20ea0 //! Metadata about the Riot API and Riven. //! diff --git a/src/models.rs b/src/models.rs index 3a69e0f..b14e3b4 100644 --- a/src/models.rs +++ b/src/models.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version ae788d19c63d356f53849f87be4d4b49b01c11de +// Version 36871d82bfc1f861d45c3941b4b5fddd3ab20ea0 //! Data transfer structs. //! @@ -580,7 +580,7 @@ pub mod match_v4 { /// String indicating whether or not the team won. There are only two values visibile in public match history.
/// (Legal values: Fail, Win) #[serde(rename = "win")] - pub win: String, + pub win: Option, } /// TeamBans data object. #[derive(Debug)] diff --git a/tests/tests_na.rs b/tests/tests_na.rs index 1e1ef61..5093abb 100644 --- a/tests/tests_na.rs +++ b/tests/tests_na.rs @@ -80,6 +80,24 @@ async_tests!{ rassert!(!m.participants.is_empty(), "Match should have participants."); Ok(()) }, + match_get_tutorial1: async { + let p = RIOT_API.match_v4().get_match(Region::NA, 3432145099); + let m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get match.".to_owned())?; + rassert!(!m.participants.is_empty(), "Match should have participants."); + Ok(()) + }, + match_get_tutorial2: async { + let p = RIOT_API.match_v4().get_match(Region::NA, 3432116214); + let m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get match.".to_owned())?; + rassert!(!m.participants.is_empty(), "Match should have participants."); + Ok(()) + }, + match_get_tutorial3: async { + let p = RIOT_API.match_v4().get_match(Region::NA, 3432156790); + let m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get match.".to_owned())?; + rassert!(!m.participants.is_empty(), "Match should have participants."); + Ok(()) + }, // Commented out, requires special API key. // // LOR // lor_ranked_get_leaderboards: async {