MCPcopy Index your code
hub / github.com/livebud/bud / TestJSONCreate204

Function TestJSONCreate204

framework/controller/controller_test.go:468–489  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

466}
467
468func TestJSONCreate204(t *testing.T) {
469 is := is.New(t)
470 ctx := context.Background()
471 dir := t.TempDir()
472 td := testdir.New(dir)
473 td.Files["controller/controller.go"] = `
474 package controller
475 type Controller struct {}
476 func (c *Controller) Create() {}
477 `
478 is.NoErr(td.Write(ctx))
479 cli := testcli.New(dir)
480 app, err := cli.Start(ctx, "run")
481 is.NoErr(err)
482 defer app.Close()
483 res, err := app.PostJSON("/", nil)
484 is.NoErr(err)
485 is.NoErr(res.Diff(`
486 HTTP/1.1 204 No Content
487 `))
488 is.NoErr(app.Close())
489}
490
491func TestJSONCreate500(t *testing.T) {
492 is := is.New(t)

Callers

nothing calls this directly

Calls 9

NewFunction · 0.92
NewFunction · 0.92
NewFunction · 0.92
NoErrMethod · 0.80
PostJSONMethod · 0.80
DiffMethod · 0.80
CloseMethod · 0.65
WriteMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected