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

Function getClientServer

deprecated-dynamic/client_test.go:61–72  ·  view source on GitHub ↗
(gv *schema.GroupVersion, h func(http.ResponseWriter, *http.Request))

Source from the content-addressed store, hash-verified

59}
60
61func getClientServer(gv *schema.GroupVersion, h func(http.ResponseWriter, *http.Request)) (Interface, *httptest.Server, error) {
62 srv := httptest.NewServer(http.HandlerFunc(h))
63 cl, err := NewClient(&restclient.Config{
64 Host: srv.URL,
65 ContentConfig: restclient.ContentConfig{GroupVersion: gv},
66 }, *gv)
67 if err != nil {
68 srv.Close()
69 return nil, nil, err
70 }
71 return cl, srv, nil
72}
73
74func TestList(t *testing.T) {
75 tcs := []struct {

Callers 8

TestListFunction · 0.70
TestGetFunction · 0.70
TestDeleteFunction · 0.70
TestDeleteCollectionFunction · 0.70
TestCreateFunction · 0.70
TestUpdateFunction · 0.70
TestWatchFunction · 0.70
TestPatchFunction · 0.70

Calls 2

NewClientFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected