MCPcopy
hub / github.com/labstack/echo / TestBindMultipartForm

Function TestBindMultipartForm

bind_test.go:426–436  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

424}
425
426func TestBindMultipartForm(t *testing.T) {
427 bodyBuffer := new(bytes.Buffer)
428 mw := multipart.NewWriter(bodyBuffer)
429 mw.WriteField("id", "1")
430 mw.WriteField("name", "Jon Snow")
431 mw.Close()
432 body := bodyBuffer.Bytes()
433
434 testBindOkay(t, bytes.NewReader(body), nil, mw.FormDataContentType())
435 testBindOkay(t, bytes.NewReader(body), dummyQuery, mw.FormDataContentType())
436}
437
438func TestBindUnsupportedMediaType(t *testing.T) {
439 testBindError(t, strings.NewReader(invalidContent), MIMEApplicationJSON, &json.SyntaxError{})

Callers

nothing calls this directly

Calls 2

testBindOkayFunction · 0.85
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…