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

Function TestRequestSetTwiceError

rest/request_test.go:181–194  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

179}
180
181func TestRequestSetTwiceError(t *testing.T) {
182 if (&Request{}).Name("bar").Name("baz").err == nil {
183 t.Errorf("setting name twice should result in error")
184 }
185 if (&Request{}).Namespace("bar").Namespace("baz").err == nil {
186 t.Errorf("setting namespace twice should result in error")
187 }
188 if (&Request{}).Resource("bar").Resource("baz").err == nil {
189 t.Errorf("setting resource twice should result in error")
190 }
191 if (&Request{}).SubResource("bar").SubResource("baz").err == nil {
192 t.Errorf("setting subresource twice should result in error")
193 }
194}
195
196func TestInvalidSegments(t *testing.T) {
197 invalidSegments := []string{".", "..", "test/segment", "test%2bsegment"}

Callers

nothing calls this directly

Calls 5

SubResourceMethod · 0.80
ErrorfMethod · 0.65
NamespaceMethod · 0.65
ResourceMethod · 0.65
NameMethod · 0.45

Tested by

no test coverage detected