MCPcopy
hub / github.com/kubernetes/client-go / TestBadRequest

Function TestBadRequest

rest/client_test.go:207–219  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

205}
206
207func TestBadRequest(t *testing.T) {
208 testServer, fakeHandler, _ := testServerEnv(t, 400)
209 defer testServer.Close()
210 c, err := restClient(testServer)
211 if err != nil {
212 t.Fatalf("unexpected error: %v", err)
213 }
214 created := false
215 body, err := c.Get().Prefix("test").Do().WasCreated(&created).Raw()
216 testParam := TestParam{actualError: err, expectingError: true, expCreated: false,
217 testBody: true}
218 validate(testParam, t, body, fakeHandler)
219}
220
221func validate(testParam TestParam, t *testing.T, body []byte, fakeHandler *utiltesting.FakeHandler) {
222 switch {

Callers

nothing calls this directly

Calls 9

testServerEnvFunction · 0.85
restClientFunction · 0.85
validateFunction · 0.85
RawMethod · 0.80
WasCreatedMethod · 0.80
PrefixMethod · 0.80
CloseMethod · 0.65
DoMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected