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

Function testRESTClient

rest/request_test.go:1854–1869  ·  view source on GitHub ↗
(t testing.TB, srv *httptest.Server)

Source from the content-addressed store, hash-verified

1852}
1853
1854func testRESTClient(t testing.TB, srv *httptest.Server) *RESTClient {
1855 baseURL, _ := url.Parse("http://localhost")
1856 if srv != nil {
1857 var err error
1858 baseURL, err = url.Parse(srv.URL)
1859 if err != nil {
1860 t.Fatalf("failed to parse test URL: %v", err)
1861 }
1862 }
1863 versionedAPIPath := defaultResourcePathWithPrefix("", "", "", "")
1864 client, err := NewRESTClient(baseURL, versionedAPIPath, defaultContentConfig(), 0, 0, nil, nil)
1865 if err != nil {
1866 t.Fatalf("failed to create a client: %v", err)
1867 }
1868 return client
1869}
1870
1871func TestDoContext(t *testing.T) {
1872 receivedCh := make(chan struct{})

Callers 15

TestDoRequestNewWayFunction · 0.85
TestBackoffLifecycleFunction · 0.85
TestCheckRetryClosesBodyFunction · 0.85
TestDoRequestNewWayObjFunction · 0.85
TestDoRequestNewWayFileFunction · 0.85
TestWasCreatedFunction · 0.85
TestVerbsFunction · 0.85
TestBodyFunction · 0.85

Calls 4

NewRESTClientFunction · 0.85
defaultContentConfigFunction · 0.85
ParseMethod · 0.45

Tested by

no test coverage detected