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

Function TestRequestVersionedParams

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

Source from the content-addressed store, hash-verified

226}
227
228func TestRequestVersionedParams(t *testing.T) {
229 r := (&Request{content: ContentConfig{GroupVersion: &v1.SchemeGroupVersion}}).Param("foo", "a")
230 if !reflect.DeepEqual(r.params, url.Values{"foo": []string{"a"}}) {
231 t.Errorf("should have set a param: %#v", r)
232 }
233 r.VersionedParams(&v1.PodLogOptions{Follow: true, Container: "bar"}, scheme.ParameterCodec)
234
235 if !reflect.DeepEqual(r.params, url.Values{
236 "foo": []string{"a"},
237 "container": []string{"bar"},
238 "follow": []string{"true"},
239 }) {
240 t.Errorf("should have set a param: %#v", r)
241 }
242}
243
244func TestRequestVersionedParamsFromListOptions(t *testing.T) {
245 r := &Request{content: ContentConfig{GroupVersion: &v1.SchemeGroupVersion}}

Callers

nothing calls this directly

Calls 3

ParamMethod · 0.80
VersionedParamsMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected