MCPcopy
hub / github.com/helm/helm / TestDownloadInsecureSkipTLSVerify

Function TestDownloadInsecureSkipTLSVerify

pkg/getter/httpgetter_test.go:484–514  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

482}
483
484func TestDownloadInsecureSkipTLSVerify(t *testing.T) {
485 ts := httptest.NewTLSServer(http.HandlerFunc(func(_ http.ResponseWriter, _ *http.Request) {}))
486 defer ts.Close()
487
488 u, _ := url.ParseRequestURI(ts.URL)
489
490 // Ensure the default behavior did not change
491 g, err := NewHTTPGetter(
492 WithURL(u.String()),
493 )
494 if err != nil {
495 t.Error(err)
496 }
497
498 if _, err := g.Get(u.String()); err == nil {
499 t.Errorf("Expected Getter to throw an error, got %s", err)
500 }
501
502 // Test certificate check skip
503 g, err = NewHTTPGetter(
504 WithURL(u.String()),
505 WithInsecureSkipVerifyTLS(true),
506 )
507 if err != nil {
508 t.Error(err)
509 }
510 if _, err = g.Get(u.String()); err != nil {
511 t.Error(err)
512 }
513
514}
515
516func TestHTTPGetterTarDownload(t *testing.T) {
517 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {

Callers

nothing calls this directly

Calls 7

GetMethod · 0.95
NewHTTPGetterFunction · 0.85
WithURLFunction · 0.85
CloseMethod · 0.80
StringMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…