(t *testing.T)
| 951 | } |
| 952 | |
| 953 | func TestSetFileWithRetry(t *testing.T) { |
| 954 | resp, err := tc().R(). |
| 955 | SetRetryCount(3). |
| 956 | SetRetryCondition(func(resp *Response, err error) bool { |
| 957 | return err != nil || resp.StatusCode > 499 |
| 958 | }). |
| 959 | SetRetryHook(func(resp *Response, err error) { |
| 960 | resp.Request.SetQueryParam("attempt", strconv.Itoa(resp.Request.RetryAttempt)) |
| 961 | }). |
| 962 | SetFile("file", tests.GetTestFilePath("sample-file.txt")). |
| 963 | SetQueryParam("attempt", "0"). |
| 964 | Post("/file-text") |
| 965 | assertSuccess(t, resp, err) |
| 966 | tests.AssertEqual(t, 2, resp.Request.RetryAttempt) |
| 967 | } |
| 968 | |
| 969 | func TestSetFile(t *testing.T) { |
| 970 | filename := "sample-file.txt" |
nothing calls this directly
no test coverage detected
searching dependent graphs…