Skip to content

Commit

Permalink
Fix error handling in TestEmail()
Browse files Browse the repository at this point in the history
  • Loading branch information
hsluoyz committed Oct 13, 2023
1 parent c350da7 commit 4985e95
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion casdoorsdk/email_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package casdoorsdk

import (
"strings"
"testing"
)

Expand All @@ -27,5 +28,10 @@ func TestEmail(t *testing.T) {
Sender: "admin",
Receivers: []string{"TestSmtpServer"},
}
SendEmail(email.Title, email.Content, email.Sender, email.Receivers...)
err := SendEmail(email.Title, email.Content, email.Sender, email.Receivers...)
if err != nil {
if !strings.Contains(err.Error(), "535 Error") {
t.Fatalf("Failed to send Email: %v", err)
}
}
}

0 comments on commit 4985e95

Please sign in to comment.