feishu_test.go 380 B

12345678910111213141516171819202122232425
  1. package notify_test
  2. import (
  3. "os"
  4. "testing"
  5. "github.com/labring/aiproxy/core/common/notify"
  6. )
  7. func TestPostToFeiShuv2(t *testing.T) {
  8. fshook := os.Getenv("FEISHU_WEBHOOK")
  9. if fshook == "" {
  10. return
  11. }
  12. err := notify.PostToFeiShuv2(
  13. t.Context(),
  14. notify.FeishuColorRed,
  15. "Error",
  16. "Error Message",
  17. os.Getenv("FEISHU_WEBHOOK"))
  18. if err != nil {
  19. t.Error(err)
  20. }
  21. }