Skip to content

Commit

Permalink
Assert env var are not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
LostQuasar committed Jun 12, 2024
1 parent 33a31a1 commit 9179d8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ mod tests {
fn setup() -> (Client, String) {
dotenv().ok();
let openshock_token = dotenv::var("OPENSHOCK_TOKEN").expect("missing OPENSHOCK_TOKEN");
assert_ne!(openshock_token, "");
let api_url = "https://api.shocklink.net";

let mut headers = header::HeaderMap::new();
Expand Down Expand Up @@ -109,7 +110,7 @@ mod tests {
async fn get_shockers_test() {
dotenv().ok();
let shocker_test_id = dotenv::var("SHOCKER_TEST_ID").expect("missing SHOCKER_TEST_ID");

assert_ne!(shocker_test_id, "");
let (client, api_url) = setup();
let result = get_shockers(&client, api_url.as_str(), ShockerSource::Own);
assert_eq!(
Expand All @@ -122,6 +123,7 @@ mod tests {
async fn post_control_test() {
dotenv().ok();
let shocker_test_id = dotenv::var("SHOCKER_TEST_ID").expect("missing SHOCKER_TEST_ID");
assert_ne!(shocker_test_id, "");

let (client, api_url) = setup();
let result = post_control(
Expand All @@ -140,6 +142,7 @@ mod tests {
async fn get_user_info_test() {
dotenv().ok();
let user_test_id = dotenv::var("USER_TEST_ID").expect("missing USER_TEST_ID");
assert_ne!(user_test_id, "");

let (client, api_url) = setup();
let result = get_user_info(&client, api_url.as_str());
Expand Down

0 comments on commit 9179d8c

Please sign in to comment.