MCPcopy Create free account
hub / github.com/couchbase/cbft / TestPingAuth

Function TestPingAuth

rest_auth_test.go:760–780  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

758}
759
760func TestPingAuth(t *testing.T) {
761 path := "/api/ping"
762
763 req, err := http.NewRequest("GET", path, nil)
764 if err != nil {
765 t.Fatal(err)
766 }
767 actualPerms, err := preparePerms(nil, &restRequestParser{req: req}, "GET", path)
768 if err != nil {
769 t.Errorf("error preparing perms: %v", err)
770 }
771
772 if actualPerms != nil {
773 t.Errorf("Invalid perms for ping %v, was not expecting any", actualPerms)
774 }
775
776 ok, _ := checkAPIAuth(nil, nil, req, path)
777 if ok != true {
778 t.Errorf("Not expecting auth failure for ping")
779 }
780}

Callers

nothing calls this directly

Calls 2

preparePermsFunction · 0.85
checkAPIAuthFunction · 0.85

Tested by

no test coverage detected