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

Function TestDoRequestSuccess

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

Source from the content-addressed store, hash-verified

70}
71
72func TestDoRequestSuccess(t *testing.T) {
73 testServer, fakeHandler, status := testServerEnv(t, 200)
74 defer testServer.Close()
75
76 c, err := restClient(testServer)
77 if err != nil {
78 t.Fatalf("unexpected error: %v", err)
79 }
80 body, err := c.Get().Prefix("test").Do().Raw()
81
82 testParam := TestParam{actualError: err, expectingError: false, expCreated: true,
83 expStatus: status, testBody: true, testBodyErrorIsNotNil: false}
84 validate(testParam, t, body, fakeHandler)
85}
86
87func TestDoRequestFailed(t *testing.T) {
88 status := &metav1.Status{

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected