Skip to content

Commit

Permalink
Update formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
LostQuasar committed Jun 12, 2024
1 parent f096d94 commit 33a31a1
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//!
//! A rust library for connecting to an openshock server


pub mod data_type;

use data_type::data_type::*;
Expand Down Expand Up @@ -105,15 +104,18 @@ mod tests {
t.hash(&mut s);
s.finish()
}

#[tokio::test]
async fn get_shockers_test() {
dotenv().ok();
let shocker_test_id = dotenv::var("SHOCKER_TEST_ID").expect("missing SHOCKER_TEST_ID");

let (client, api_url) = setup();
let result = get_shockers(&client, api_url.as_str(), ShockerSource::Own);
assert_eq!(calculate_hash(&result.await.unwrap()[0].shockers[0].id), calculate_hash(&shocker_test_id));
assert_eq!(
calculate_hash(&result.await.unwrap()[0].shockers[0].id),
calculate_hash(&shocker_test_id)
);
}

#[tokio::test]
Expand All @@ -128,7 +130,10 @@ mod tests {
shocker_test_id,
ControlType::Sound,
);
assert_eq!(&result.await.unwrap(), &"Successfully sent control messages");
assert_eq!(
&result.await.unwrap(),
&"Successfully sent control messages"
);
}

#[tokio::test]
Expand All @@ -138,6 +143,9 @@ mod tests {

let (client, api_url) = setup();
let result = get_user_info(&client, api_url.as_str());
assert_eq!(calculate_hash(&result.await.unwrap().id), calculate_hash(&user_test_id));
assert_eq!(
calculate_hash(&result.await.unwrap().id),
calculate_hash(&user_test_id)
);
}
}

0 comments on commit 33a31a1

Please sign in to comment.