MCPcopy
hub / github.com/oauth2-proxy/oauth2-proxy / Test_redeemCode

Function Test_redeemCode

oauthproxy_test.go:108–121  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

106}
107
108func Test_redeemCode(t *testing.T) {
109 opts := baseTestOptions()
110 err := validation.Validate(opts)
111 assert.NoError(t, err)
112
113 proxy, err := NewOAuthProxy(opts, func(string) bool { return true })
114 if err != nil {
115 t.Fatal(err)
116 }
117
118 req := httptest.NewRequest(http.MethodGet, "/", nil)
119 _, err = proxy.redeemCode(req, "")
120 assert.Equal(t, providers.ErrMissingCode, err)
121}
122
123func Test_enrichSession(t *testing.T) {
124 const (

Callers

nothing calls this directly

Calls 4

redeemCodeMethod · 0.95
ValidateFunction · 0.92
baseTestOptionsFunction · 0.85
NewOAuthProxyFunction · 0.85

Tested by

no test coverage detected