feat: create standalone native fnOS repository
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package notify
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestBuildMailBody(t *testing.T) {
|
||||
content := FormatAlert("test", "标题", "正文")
|
||||
body := string(buildMailBody("from@example.com", []string{"to@example.com"}, content.Subject, content.PlainBody))
|
||||
if !strings.Contains(body, "Subject: [Havline]") {
|
||||
t.Fatalf("missing subject: %s", body)
|
||||
}
|
||||
if !strings.Contains(body, "正文") {
|
||||
t.Fatalf("missing message: %s", body)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user