MCPcopy
hub / github.com/livebud/bud / TestNoActions

Function TestNoActions

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

Source from the content-addressed store, hash-verified

17)
18
19func TestNoActions(t *testing.T) {
20 is := is.New(t)
21 ctx := context.Background()
22 dir := t.TempDir()
23 td := testdir.New(dir)
24 td.Files["controller/controller.go"] = `
25 package controller
26 type Controller struct {}
27 `
28 is.NoErr(td.Write(ctx))
29 cli := testcli.New(dir)
30 app, err := cli.Start(ctx, "run")
31 is.NoErr(err)
32 defer app.Close()
33 // HTML response
34 res, err := app.Get("/")
35 is.NoErr(err)
36 is.NoErr(res.DiffHeaders(`
37 HTTP/1.1 404 Not Found
38 Content-Type: text/plain; charset=utf-8
39 X-Content-Type-Options: nosniff
40 `))
41 is.NoErr(app.Close())
42}
43
44func TestIndexString(t *testing.T) {
45 is := is.New(t)

Callers

nothing calls this directly

Calls 9

NewFunction · 0.92
NewFunction · 0.92
NewFunction · 0.92
NoErrMethod · 0.80
DiffHeadersMethod · 0.80
CloseMethod · 0.65
GetMethod · 0.65
WriteMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected