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

Function TestDoRequestCreated

rest/client_test.go:162–176  ·  rest/client_test.go::TestDoRequestCreated
(t *testing.T)

Source from the content-addressed store, hash-verified

160}
161
162func TestDoRequestCreated(t *testing.T) {
163 testServer, fakeHandler, status := testServerEnv(t, 201)
164 defer testServer.Close()
165
166 c, err := restClient(testServer)
167 if err != nil {
168 t.Fatalf("unexpected error: %v", err)
169 }
170 created := false
171 body, err := c.Get().Prefix("test").Do().WasCreated(&created).Raw()
172
173 testParam := TestParam{actualError: err, expectingError: false, expCreated: true,
174 expStatus: status, testBody: false}
175 validate(testParam, t, body, fakeHandler)
176}
177
178func TestDoRequestNotCreated(t *testing.T) {
179 testServer, fakeHandler, expectedStatus := testServerEnv(t, 202)

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