MCPcopy
hub / github.com/helm/helm / TestConvertOptions

Function TestConvertOptions

pkg/getter/plugingetter_test.go:59–96  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestConvertOptions(t *testing.T) {
60 opts := convertOptions(
61 []Option{
62 WithURL("example://foo"),
63 WithAcceptHeader("Accept-Header"),
64 WithBasicAuth("username", "password"),
65 WithPassCredentialsAll(true),
66 WithUserAgent("User-agent"),
67 WithInsecureSkipVerifyTLS(true),
68 WithTLSClientConfig("certFile.pem", "keyFile.pem", "caFile.pem"),
69 WithPlainHTTP(true),
70 WithTimeout(10),
71 WithTagName("1.2.3"),
72 WithUntar(),
73 },
74 []Option{
75 WithTimeout(20),
76 },
77 )
78
79 expected := schema.GetterOptionsV1{
80 URL: "example://foo",
81 CertFile: "certFile.pem",
82 KeyFile: "keyFile.pem",
83 CAFile: "caFile.pem",
84 UNTar: true,
85 Timeout: 20,
86 InsecureSkipVerifyTLS: true,
87 PlainHTTP: true,
88 AcceptHeader: "Accept-Header",
89 Username: "username",
90 Password: "password",
91 PassCredentialsAll: true,
92 UserAgent: "User-agent",
93 Version: "1.2.3",
94 }
95 assert.Equal(t, expected, opts)
96}
97
98type testPlugin struct {
99 t *testing.T

Callers

nothing calls this directly

Calls 12

convertOptionsFunction · 0.85
WithURLFunction · 0.85
WithAcceptHeaderFunction · 0.85
WithBasicAuthFunction · 0.85
WithUserAgentFunction · 0.85
WithTimeoutFunction · 0.85
WithTagNameFunction · 0.85
WithUntarFunction · 0.85
WithPassCredentialsAllFunction · 0.70
WithTLSClientConfigFunction · 0.70
WithPlainHTTPFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…