(t *testing.T)
| 39 | } |
| 40 | |
| 41 | func TestBasePathHealthz(t *testing.T) { |
| 42 | srv := newBasePathServer(t, "/zennotes") |
| 43 | resp, err := http.Get(srv.URL + "/zennotes/api/healthz") |
| 44 | if err != nil { |
| 45 | t.Fatalf("get under base: %v", err) |
| 46 | } |
| 47 | defer resp.Body.Close() |
| 48 | if resp.StatusCode != http.StatusOK { |
| 49 | t.Fatalf("status under base: %d", resp.StatusCode) |
| 50 | } |
| 51 | |
| 52 | off, err := http.Get(srv.URL + "/api/healthz") |
| 53 | if err != nil { |
| 54 | t.Fatalf("get without base: %v", err) |
| 55 | } |
| 56 | defer off.Body.Close() |
| 57 | if off.StatusCode == http.StatusOK { |
| 58 | t.Fatalf("requests outside the base path should not match: got 200") |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | func TestBasePathServesStaticAssets(t *testing.T) { |
| 63 | srv := newBasePathServer(t, "/zennotes") |
nothing calls this directly
no test coverage detected