Skip to content

Commit

Permalink
Add a test sending to specific device by its name.
Browse files Browse the repository at this point in the history
  • Loading branch information
Emka877 committed Nov 13, 2024
1 parent efb6b59 commit 504e8a0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/tests/no_github_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,26 @@ pub fn test_testdata_readability() {
assert_eq!(testdata.is_ok(), true);
}

#[tokio::test]
async fn test_send_minimal_message_specific_device() {
// Device name is set on the Pushover dashboard.
// You can join multiple singular devices by separating them with a comma (eg: "MyPhone,MyOtherPhone")
let device_name: &str = "MyPhone";
if let Ok(credentials) = read_test_data() {
let message: Message = MessageBuilder::new(
credentials.user_key.as_str(),
credentials.app_token.as_str(),
"Test from pushover-rs.",
)
.set_device(device_name)
.build();
let response = send_pushover_request(message).await;
assert_eq!(response.is_ok(), true);
} else {
panic!("Could not read test data.");
}
}

#[tokio::test]
async fn test_send_request_minimal_message() {
if let Ok(credentials) = read_test_data() {
Expand Down

0 comments on commit 504e8a0

Please sign in to comment.