MCPcopy Create free account
hub / github.com/imroc/req / TestSetFiles

Function TestSetFiles

request_test.go:980–988  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

978}
979
980func TestSetFiles(t *testing.T) {
981 filename := "sample-file.txt"
982 resp := uploadTextFile(t, func(r *Request) {
983 r.SetFiles(map[string]string{
984 "file": tests.GetTestFilePath(filename),
985 })
986 })
987 tests.AssertEqual(t, getTestFileContent(t, filename), resp.Bytes())
988}
989
990func uploadTextFile(t *testing.T, setReq func(r *Request)) *Response {
991 r := tc().R()

Callers

nothing calls this directly

Calls 6

GetTestFilePathFunction · 0.92
AssertEqualFunction · 0.92
uploadTextFileFunction · 0.85
getTestFileContentFunction · 0.85
SetFilesMethod · 0.80
BytesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…