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

Function TestUnacceptableParamNames

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

Source from the content-addressed store, hash-verified

1686}
1687
1688func TestUnacceptableParamNames(t *testing.T) {
1689 table := []struct {
1690 name string
1691 testVal string
1692 expectSuccess bool
1693 }{
1694 // timeout is no longer "protected"
1695 {"timeout", "42", true},
1696 }
1697
1698 for _, item := range table {
1699 c := testRESTClient(t, nil)
1700 r := c.Get().setParam(item.name, item.testVal)
1701 if e, a := item.expectSuccess, r.err == nil; e != a {
1702 t.Errorf("expected %v, got %v (%v)", e, a, r.err)
1703 }
1704 }
1705}
1706
1707func TestBody(t *testing.T) {
1708 const data = "test payload"

Callers

nothing calls this directly

Calls 4

testRESTClientFunction · 0.85
setParamMethod · 0.80
GetMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected