mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-20 21:26:01 +08:00
18 lines
310 B
Go
18 lines
310 B
Go
package multipart
|
|
|
|
import (
|
|
"bytes"
|
|
"io"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestReader(t *testing.T) {
|
|
body := "this is the file body message!!!"
|
|
r := NewReader(strings.NewReader(body), "", "test.txt")
|
|
var buf bytes.Buffer
|
|
io.Copy(&buf, r)
|
|
t.Logf("%s", r.FormDataContentType())
|
|
t.Logf("%s", buf.String())
|
|
}
|