1
Fork 0
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:
Steffo 2023-03-24 01:19:27 +01:00
parent 0a21a4ccf9
commit 0573287708
Signed by: steffo
GPG key ID: 2A24051445686895
4 changed files with 3 additions and 21 deletions

View file

@ -51,6 +51,7 @@ anyhow = { version = "^1.0.68", optional = true }
[features]
jpg = ["hmac", "sha2", "base64", "hex"]
test = ["tokio"]
exec = ["pretty_env_logger"]
search = ["tantivy"]
telegram = ["exec", "search", "jpg", "teloxide", "tokio", "md5", "rand"]

View file

@ -101,7 +101,7 @@ mod tests {
#[tokio::test]
async fn $id() {
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());
}
};

View file

@ -137,23 +137,4 @@ mod tests {
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") });
}
#[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"
);
}
}

View file

@ -81,7 +81,7 @@ mod tests {
#[tokio::test]
async fn $id() {
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());
}
};