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

Function TestRequestParam

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

Source from the content-addressed store, hash-verified

213}
214
215func TestRequestParam(t *testing.T) {
216 r := (&Request{}).Param("foo", "a")
217 if !reflect.DeepEqual(r.params, url.Values{"foo": []string{"a"}}) {
218 t.Errorf("should have set a param: %#v", r)
219 }
220
221 r.Param("bar", "1")
222 r.Param("bar", "2")
223 if !reflect.DeepEqual(r.params, url.Values{"foo": []string{"a"}, "bar": []string{"1", "2"}}) {
224 t.Errorf("should have set a param: %#v", r)
225 }
226}
227
228func TestRequestVersionedParams(t *testing.T) {
229 r := (&Request{content: ContentConfig{GroupVersion: &v1.SchemeGroupVersion}}).Param("foo", "a")

Callers

nothing calls this directly

Calls 2

ParamMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected