MCPcopy Index your code
hub / github.com/ZenNotes/zennotes / TestBasePathHealthz

Function TestBasePathHealthz

apps/server/internal/httpserver/basepath_test.go:41–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

39}
40
41func 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
62func TestBasePathServesStaticAssets(t *testing.T) {
63 srv := newBasePathServer(t, "/zennotes")

Callers

nothing calls this directly

Calls 2

newBasePathServerFunction · 0.85
CloseMethod · 0.80

Tested by

no test coverage detected