Skip to content

Commit

Permalink
Move await
Browse files Browse the repository at this point in the history
  • Loading branch information
LostQuasar committed Jun 13, 2024
1 parent 7233ec9 commit 5631e3d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ mod tests {

let openshock_api = OpenShockAPI::new(None, openshock_token);

let result = openshock_api.get_shockers(ShockerSource::Own, None);
let result = openshock_api.get_shockers(ShockerSource::Own, None).await;
assert_eq!(
calculate_hash(&result.await.unwrap()[0].shockers[0].id),
calculate_hash(&result.unwrap()[0].shockers[0].id),
calculate_hash(&shocker_test_id)
);
}
Expand All @@ -151,9 +151,9 @@ mod tests {
assert_ne!(shocker_test_id, "");

let openshock_api = OpenShockAPI::new(None, openshock_token);
let result = openshock_api.post_control(shocker_test_id, ControlType::Sound, None);
let result = openshock_api.post_control(shocker_test_id, ControlType::Sound, None).await;
assert_eq!(
&result.await.unwrap(),
&result.unwrap(),
&"Successfully sent control messages"
);
}
Expand All @@ -167,9 +167,9 @@ mod tests {
assert_ne!(openshock_token, "");

let openshock_api = OpenShockAPI::new(None, openshock_token);
let result = openshock_api.get_user_info(None);
let result = openshock_api.get_user_info(None).await;
assert_eq!(
calculate_hash(&result.await.unwrap().id),
calculate_hash(&result.unwrap().id),
calculate_hash(&user_test_id)
);
}
Expand Down

0 comments on commit 5631e3d

Please sign in to comment.