mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2025-01-24 09:47:26 -08:00
update league tests for regen
This commit is contained in:
parent
cc2f419dfb
commit
5b70c9203c
1 changed files with 15 additions and 7 deletions
|
@ -1,4 +1,6 @@
|
|||
mod testutils;
|
||||
use core::option::Option::None;
|
||||
|
||||
use riven::consts::*;
|
||||
use testutils::*;
|
||||
|
||||
|
@ -26,9 +28,11 @@ async fn league_get_diamond() -> Result<(), String> {
|
|||
Division::IV,
|
||||
None,
|
||||
);
|
||||
let d = p.await.map_err(|e| e.to_string())?;
|
||||
if d.is_empty() {
|
||||
eprintln!("Diamond league is empty!");
|
||||
let opt = p.await.map_err(|e| e.to_string())?;
|
||||
if let Some(list) = opt {
|
||||
assert!(!list.is_empty(), "Returns 204 (`None`) when empty.");
|
||||
} else {
|
||||
eprintln!("Off-season, challenger league is empty.");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -38,8 +42,8 @@ async fn league_get_challenger() -> Result<(), String> {
|
|||
let p = riot_api()
|
||||
.league_v4()
|
||||
.get_challenger_league(ROUTE, QueueType::RANKED_SOLO_5x5);
|
||||
let d = p.await.map_err(|e| e.to_string())?;
|
||||
if d.entries.is_empty() {
|
||||
let ll = p.await.map_err(|e| e.to_string())?;
|
||||
if ll.entries.is_empty() {
|
||||
eprintln!("Off-season, challenger league is empty.");
|
||||
}
|
||||
Ok(())
|
||||
|
@ -54,8 +58,12 @@ async fn leagueexp_get_challenger() -> Result<(), String> {
|
|||
Division::I,
|
||||
None,
|
||||
);
|
||||
let d = p.await.map_err(|e| e.to_string())?;
|
||||
assert!(!d.is_empty(), "Returns 204 (`None`) when empty.");
|
||||
let opt = p.await.map_err(|e| e.to_string())?;
|
||||
if let Some(list) = opt {
|
||||
assert!(!list.is_empty(), "Returns 204 (`None`) when empty.");
|
||||
} else {
|
||||
eprintln!("Off-season, challenger league is empty.");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue