MCPcopy
hub / github.com/caddyserver/caddy / TestBrowse

Function TestBrowse

caddytest/integration/handler_test.go:11–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestBrowse(t *testing.T) {
12 tester := caddytest.NewTester(t)
13 tester.InitServer(`
14 {
15 skip_install_trust
16 admin localhost:2999
17 http_port 9080
18 https_port 9443
19 grace_period 1ns
20 }
21 http://localhost:9080 {
22 file_server browse
23 }
24 `, "caddyfile")
25
26 req, err := http.NewRequest(http.MethodGet, "http://localhost:9080/", nil)
27 if err != nil {
28 t.Fail()
29 return
30 }
31 tester.AssertResponseCode(req, 200)
32}
33
34func TestRespondWithJSON(t *testing.T) {
35 tester := caddytest.NewTester(t)

Callers

nothing calls this directly

Calls 3

InitServerMethod · 0.95
AssertResponseCodeMethod · 0.95
NewTesterFunction · 0.92

Tested by

no test coverage detected