(t *testing.T)
| 73 | } |
| 74 | |
| 75 | func TestRequestSetsHeaders(t *testing.T) { |
| 76 | server := clientFunc(func(req *http.Request) (*http.Response, error) { |
| 77 | if req.Header.Get("Accept") != "application/other, */*" { |
| 78 | t.Errorf("unexpected headers: %#v", req.Header) |
| 79 | } |
| 80 | return &http.Response{ |
| 81 | StatusCode: http.StatusForbidden, |
| 82 | Body: ioutil.NopCloser(bytes.NewReader([]byte{})), |
| 83 | }, nil |
| 84 | }) |
| 85 | config := defaultContentConfig() |
| 86 | config.ContentType = "application/other" |
| 87 | serializers := defaultSerializers(t) |
| 88 | r := NewRequest(server, "get", &url.URL{Path: "/path"}, "", config, serializers, nil, nil, 0) |
| 89 | |
| 90 | // Check if all "issue" methods are setting headers. |
| 91 | _ = r.Do() |
| 92 | _, _ = r.Watch() |
| 93 | _, _ = r.Stream() |
| 94 | } |
| 95 | |
| 96 | func TestRequestWithErrorWontChange(t *testing.T) { |
| 97 | gvCopy := v1.SchemeGroupVersion |
nothing calls this directly
no test coverage detected