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

Function TestSetFileReader

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

Source from the content-addressed store, hash-verified

937}
938
939func TestSetFileReader(t *testing.T) {
940 buff := bytes.NewBufferString("test")
941 resp := uploadTextFile(t, func(r *Request) {
942 r.SetFileReader("file", "file.txt", buff)
943 })
944 tests.AssertEqual(t, "test", resp.String())
945
946 buff = bytes.NewBufferString("test")
947 resp = uploadTextFile(t, func(r *Request) {
948 r.SetFileReader("file", "file.txt", io.NopCloser(buff))
949 })
950 tests.AssertEqual(t, "test", resp.String())
951}
952
953func TestSetFileWithRetry(t *testing.T) {
954 resp, err := tc().R().

Callers

nothing calls this directly

Calls 4

AssertEqualFunction · 0.92
uploadTextFileFunction · 0.85
SetFileReaderMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…