Created
February 26, 2024 12:20
-
-
Save simanacci/f9ae188c44d4e5bd822177e458bd27bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[actix_web::test] | |
async fn units() -> anyhow::Result<()> { | |
std::env::set_var("RUST_LOG", "info"); | |
std::env::set_var("RUST_BACKTRACE", "1"); | |
dotenv::dotenv().ok(); | |
let ctx = TestContext::new(); | |
let meter = general::M1; | |
let gadget = fixtures::gadget(&ctx.client, meter, Uuid::new_v4()).await?; | |
let message = | |
fixtures::message(&ctx.client, CLASSIC, Some(gadget.uuid), Uuid::new_v4()).await?; | |
let res = Message::units(&message.sms)?; | |
// Test | |
assert!(res.is_some()); | |
assert_eq!(res.unwrap(), general::U1); | |
Ok(()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment