(t *testing.T)
| 592 | } |
| 593 | |
| 594 | func TestTooLargeText(t *testing.T) { |
| 595 | fpath := filepath.Join(os.TempDir(), "files") |
| 596 | defer os.RemoveAll(fpath) |
| 597 | os.MkdirAll(fpath+"/files/", os.ModePerm) // nolint: errcheck |
| 598 | logic.APIEndpoint = "http://127.0.0.1" |
| 599 | c := New() |
| 600 | defer c.Close() |
| 601 | c.Init(&logic.Options{DBUrl: "sqlite://?mode=memory", FilePath: fpath}) // nolint: errcheck |
| 602 | |
| 603 | tk, _ := model.ParseToken("EgMxMjMiBGNoYW4qBU1GUkdHMhQZZ_-_F4Oa-oQO0sLHXKqNSU8Qmw..c2lnbg") // nolint: errcheck |
| 604 | w := httptest.NewRecorder() |
| 605 | ctx, _ := gin.CreateTestContext(w) |
| 606 | ctx.Request, _ = http.NewRequest("GET", "/", nil) |
| 607 | if _, err := c.makeTextContent(model.NewMessage(tk), strings.Repeat("1", 1001), strings.Repeat("2", 1001), "", "1", nil); err != nil { |
| 608 | t.Error("Fix too large text failed", err) |
| 609 | } |
| 610 | } |
| 611 | |
| 612 | func TestTooLargeTextNoTitle(t *testing.T) { |
| 613 | fpath := filepath.Join(os.TempDir(), "files") |
nothing calls this directly
no test coverage detected