Skip to content

Commit

Permalink
Merge 08c105a into 0453509
Browse files Browse the repository at this point in the history
  • Loading branch information
PouuleT committed May 18, 2021
2 parents 0453509 + 08c105a commit 318e110
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pushover.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ var (
ErrEmptyURL = errors.New("pushover: empty URL, URLTitle needs an URL")
ErrEmptyRecipientToken = errors.New("pushover: empty recipient token")
ErrInvalidRecipientToken = errors.New("pushover: invalid recipient token")
ErrInvalidRecipient = errors.New("pushover: invalid recipient")
ErrInvalidHeaders = errors.New("pushover: invalid headers in server response")
ErrInvalidPriority = errors.New("pushover: invalid priority")
ErrInvalidToken = errors.New("pushover: invalid API token")
Expand Down Expand Up @@ -161,8 +160,9 @@ func (p *Pushover) GetReceiptDetails(receipt string) (*ReceiptDetails, error) {
}

// GetRecipientDetails allows to check if a recipient exists, if it's a group
// and the devices associated to this recipient. It returns an
// ErrInvalidRecipient if the recipient is not valid in the Pushover API.
// and the devices associated to this recipient. The Errors field of the
// RecipientDetails object will contain an error if the recipient is not valid
// in the Pushover API.
func (p *Pushover) GetRecipientDetails(recipient *Recipient) (*RecipientDetails, error) {
endpoint := fmt.Sprintf("%s/users/validate.json", APIEndpoint)

Expand Down
8 changes: 4 additions & 4 deletions pushover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ func TestPostFormErrors(t *testing.T) {
}
}

// TestGetRecipienDetails
func TestGetRecipienDetails(t *testing.T) {
// TestGetRecipientDetails
func TestGetRecipientDetails(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, `{"status":1,"request":"e460545a8b333d0da2f3602aff3133d6"}`)
}))
Expand All @@ -170,8 +170,8 @@ func TestGetRecipienDetails(t *testing.T) {
}
}

// TestGetRecipienDetailsError
func TestGetRecipienDetailsError(t *testing.T) {
// TestGetRecipientDetailsError
func TestGetRecipientDetailsError(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, `{"status":0,"request":"e460545a8b333d0da2f3602aff3133d6", "errors": ["user key is invalid"]}`)
}))
Expand Down

0 comments on commit 318e110

Please sign in to comment.