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

Function TestNew

transport/transport_test.go:96–314  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

94)
95
96func TestNew(t *testing.T) {
97 testCases := map[string]struct {
98 Config *Config
99 Err bool
100 TLS bool
101 TLSCert bool
102 TLSErr bool
103 Default bool
104 Insecure bool
105 DefaultRoots bool
106 }{
107 "default transport": {
108 Default: true,
109 Config: &Config{},
110 },
111
112 "insecure": {
113 TLS: true,
114 Insecure: true,
115 DefaultRoots: true,
116 Config: &Config{TLS: TLSConfig{
117 Insecure: true,
118 }},
119 },
120
121 "server name": {
122 TLS: true,
123 DefaultRoots: true,
124 Config: &Config{TLS: TLSConfig{
125 ServerName: "foo",
126 }},
127 },
128
129 "ca transport": {
130 TLS: true,
131 Config: &Config{
132 TLS: TLSConfig{
133 CAData: []byte(rootCACert),
134 },
135 },
136 },
137 "bad ca file transport": {
138 Err: true,
139 Config: &Config{
140 TLS: TLSConfig{
141 CAFile: "invalid file",
142 },
143 },
144 },
145 "ca data overriding bad ca file transport": {
146 TLS: true,
147 Config: &Config{
148 TLS: TLSConfig{
149 CAData: []byte(rootCACert),
150 CAFile: "invalid file",
151 },
152 },
153 },

Callers

nothing calls this directly

Calls 4

NewFunction · 0.70
RunMethod · 0.65
ErrorMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected