MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / createWSForTest

Function createWSForTest

internal/server/server_test.go:227–236  ·  view source on GitHub ↗
(t *testing.T, srv *Server)

Source from the content-addressed store, hash-verified

225}
226
227func createWSForTest(t *testing.T, srv *Server) string {
228 t.Helper()
229 rr := doRequest(srv, "POST", "/api/v1/workspaces", map[string]string{"name": "Test"})
230 if rr.Code != http.StatusCreated {
231 t.Fatalf("failed to create test workspace: %d %s", rr.Code, rr.Body.String())
232 }
233 var ws models.Workspace
234 parseJSON(t, rr, &ws)
235 return ws.Slug
236}
237
238func TestDocumentEndpoints(t *testing.T) {
239 srv := testServer(t)

Calls 3

doRequestFunction · 0.85
parseJSONFunction · 0.85
StringMethod · 0.80

Tested by

no test coverage detected