mirror of
https://github.com/Steffo99/patched-porobot.git
synced 2025-01-03 15:34:18 +00:00
Fix some tests
This commit is contained in:
parent
0a21a4ccf9
commit
0573287708
4 changed files with 3 additions and 21 deletions
|
@ -51,6 +51,7 @@ anyhow = { version = "^1.0.68", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
jpg = ["hmac", "sha2", "base64", "hex"]
|
jpg = ["hmac", "sha2", "base64", "hex"]
|
||||||
|
test = ["tokio"]
|
||||||
exec = ["pretty_env_logger"]
|
exec = ["pretty_env_logger"]
|
||||||
search = ["tantivy"]
|
search = ["tantivy"]
|
||||||
telegram = ["exec", "search", "jpg", "teloxide", "tokio", "md5", "rand"]
|
telegram = ["exec", "search", "jpg", "teloxide", "tokio", "md5", "rand"]
|
||||||
|
|
|
@ -101,7 +101,7 @@ mod tests {
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn $id() {
|
async fn $id() {
|
||||||
let client = reqwest::Client::new();
|
let client = reqwest::Client::new();
|
||||||
let result = CoreBundle::fetch(&client, &format!("https://dd.b.pvp.net/{}", $version), $locale).await;
|
let result = crate::data::corebundle::CoreBundle::fetch(&client, &format!("https://dd.b.pvp.net/{}", $version), $locale).await;
|
||||||
assert!(result.is_ok());
|
assert!(result.is_ok());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -137,23 +137,4 @@ mod tests {
|
||||||
fn deserialize() {
|
fn deserialize() {
|
||||||
assert_eq!(serde_json::de::from_str::<'static, CardArt>(r#"{"gameAbsolutePath": "https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001.png", "fullAbsolutePath": "https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001-full.png"}"#).unwrap(), CardArt { card_png: String::from("https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001.png"), full_png: String::from("https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001-full.png") });
|
assert_eq!(serde_json::de::from_str::<'static, CardArt>(r#"{"gameAbsolutePath": "https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001.png", "fullAbsolutePath": "https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001-full.png"}"#).unwrap(), CardArt { card_png: String::from("https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001.png"), full_png: String::from("https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001-full.png") });
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn png_to_jpg() {
|
|
||||||
let art = CardArt {
|
|
||||||
card_png: String::from("https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001.png"),
|
|
||||||
full_png: String::from(
|
|
||||||
"https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001-full.png",
|
|
||||||
),
|
|
||||||
};
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
art.card_jpg(),
|
|
||||||
"https://objectstorage.eu-milan-1.oraclecloud.com/n/axxdmk4y92aq/b/porobot-storage/o/set1-en_us/en_us/img/cards/01DE001.jpg"
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
art.full_jpg(),
|
|
||||||
"https://objectstorage.eu-milan-1.oraclecloud.com/n/axxdmk4y92aq/b/porobot-storage/o/set1-en_us/en_us/img/cards/01DE001-full.jpg"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ mod tests {
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn $id() {
|
async fn $id() {
|
||||||
let client = reqwest::Client::new();
|
let client = reqwest::Client::new();
|
||||||
let result = SetBundle::fetch(&client, &format!("https://dd.b.pvp.net/{}", $version), $locale, $set).await;
|
let result = crate::data::setbundle::SetBundle::fetch(&client, &format!("https://dd.b.pvp.net/{}", $version), $locale, $set).await;
|
||||||
assert!(result.is_ok());
|
assert!(result.is_ok());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue