H-300: wire Captain Skills into Web runtime (#48)
* H-300: wire Captain Skills into Web runtime * H-300: enforce effective model and conservative skill budget * H-300: fix CI gosec step * ci: extend golangci-lint timeout * fix lint findings across backend * fix(push): resolve delivery protocol blockers * test(repository): close SQLite test databases * test(repository): reuse SQLite schema per package * H-307: restore backend Go cache in CI * H-307: prefetch modules before cold lint * H-307: resolve govulncheck security gate * H-307: build lint with patched Go toolchain * H-307: clear remaining security scan findings --------- Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/stretchr/testify/suite"
|
||||
"gorm.io/driver/sqlite"
|
||||
"gorm.io/gorm"
|
||||
@@ -309,8 +310,8 @@ func (s *WidgetThemeHandlerTestSuite) TestStageFileUpload_NoFileField() {
|
||||
// Send multipart form without a "file" field
|
||||
body := &bytes.Buffer{}
|
||||
writer := multipart.NewWriter(body)
|
||||
writer.WriteField("website_token", "test_token")
|
||||
writer.Close()
|
||||
require.NoError(s.T(), writer.WriteField("website_token", "test_token"))
|
||||
require.NoError(s.T(), writer.Close())
|
||||
|
||||
req, _ := http.NewRequest("POST", "/widget/test_token/uploads", body)
|
||||
req.Header.Set("Content-Type", writer.FormDataContentType())
|
||||
@@ -327,8 +328,9 @@ func (s *WidgetThemeHandlerTestSuite) TestStageFileUpload_InvalidWebsiteToken()
|
||||
writer := multipart.NewWriter(body)
|
||||
part, err := writer.CreateFormFile("file", "test.txt")
|
||||
assert.NoError(s.T(), err)
|
||||
part.Write([]byte("hello world"))
|
||||
writer.Close()
|
||||
_, err = part.Write([]byte("hello world"))
|
||||
require.NoError(s.T(), err)
|
||||
require.NoError(s.T(), writer.Close())
|
||||
|
||||
req, _ := http.NewRequest("POST", "/widget/nonexistent_token/uploads", body)
|
||||
req.Header.Set("Content-Type", writer.FormDataContentType())
|
||||
|
||||
Reference in New Issue
Block a user