(t *testing.T)
| 758 | } |
| 759 | |
| 760 | func 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 | } |
nothing calls this directly
no test coverage detected