(code int, gv schema.GroupVersion, body string)
| 106 | } |
| 107 | |
| 108 | func fakeClientWith(code int, gv schema.GroupVersion, body string) *fake.RESTClient { |
| 109 | return &fake.RESTClient{ |
| 110 | GroupVersion: gv, |
| 111 | NegotiatedSerializer: scheme.Codecs.WithoutConversion(), |
| 112 | Client: fake.CreateHTTPClient(func(_ *http.Request) (*http.Response, error) { |
| 113 | header := http.Header{} |
| 114 | header.Set("Content-Type", runtime.ContentTypeJSON) |
| 115 | return &http.Response{ |
| 116 | StatusCode: code, |
| 117 | Header: header, |
| 118 | Body: stringBody(body), |
| 119 | }, nil |
| 120 | }), |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | func TestRequireAdoption(t *testing.T) { |
| 125 | var ( |
no test coverage detected
searching dependent graphs…