MCPcopy Create free account
hub / github.com/chanify/chanify / TestSendAction

Function TestSendAction

core/sender_test.go:664–683  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

662}
663
664func TestSendAction(t *testing.T) {
665 logic.APIEndpoint = "http://127.0.0.1"
666 c := New()
667 defer c.Close()
668 c.Init(&logic.Options{DBUrl: "sqlite://?mode=memory"}) // nolint: errcheck
669
670 tk, _ := model.ParseToken("EgMxMjMiBGNoYW4qBU1GUkdHMhQZZ_-_F4Oa-oQO0sLHXKqNSU8Qmw..c2lnbg") // nolint: errcheck
671 w := httptest.NewRecorder()
672 ctx, _ := gin.CreateTestContext(w)
673 ctx.Request, _ = http.NewRequest("GET", "/", nil)
674 if _, err := c.makeTextContent(model.NewMessage(tk), "123", "abc", "", "1", []string{
675 "1|http://127.0.0.1/action1",
676 "2|http://127.0.0.1/action2",
677 "3|http://127.0.0.1/action3",
678 "4|http://127.0.0.1/action4",
679 "5|http://127.0.0.1/action5",
680 }); err != nil {
681 t.Error("Send action failed", err)
682 }
683}
684
685func TestSendActionFailed(t *testing.T) {
686 logic.APIEndpoint = "http://127.0.0.1"

Callers

nothing calls this directly

Calls 6

ParseTokenFunction · 0.92
NewMessageFunction · 0.92
NewFunction · 0.85
InitMethod · 0.80
makeTextContentMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected