MCPcopy Create free account
hub / github.com/imroc/req / TestSetBasicAuth

Function TestSetBasicAuth

request_test.go:498–506  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

496}
497
498func TestSetBasicAuth(t *testing.T) {
499 headers := make(http.Header)
500 resp, err := tc().R().
501 SetBasicAuth("imroc", "123456").
502 SetSuccessResult(&headers).
503 Get("/header")
504 assertSuccess(t, resp, err)
505 tests.AssertEqual(t, "Basic aW1yb2M6MTIzNDU2", headers.Get("Authorization"))
506}
507
508func TestSetBearerAuthToken(t *testing.T) {
509 token := "NGU1ZWYwZDJhNmZhZmJhODhmMjQ3ZDc4"

Callers

nothing calls this directly

Calls 7

AssertEqualFunction · 0.92
tcFunction · 0.85
assertSuccessFunction · 0.85
SetSuccessResultMethod · 0.80
SetBasicAuthMethod · 0.80
RMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…