(t *testing.T)
| 662 | } |
| 663 | |
| 664 | func 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 | |
| 685 | func TestSendActionFailed(t *testing.T) { |
| 686 | logic.APIEndpoint = "http://127.0.0.1" |
nothing calls this directly
no test coverage detected