MCPcopy
hub / github.com/cortesi/devd / TestRouteHandler

Function TestRouteHandler

route_test.go:143–170  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

141}
142
143func TestRouteHandler(t *testing.T) {
144 var routeHandlerTests = []struct {
145 spec string
146 }{
147 {"/one=two"},
148 }
149 for i, tt := range routeHandlerTests {
150 r, err := newRoute(tt.spec, []string{})
151 if err != nil {
152 t.Errorf(
153 "Test %d, unexpected error:\n%s\n",
154 i,
155 err,
156 )
157 }
158
159 rb, err := rice.FindBox("templates")
160 if err != nil {
161 t.Error(err)
162 }
163 templates, err := ricetemp.MakeTemplates(rb)
164 if err != nil {
165 panic(err)
166 }
167
168 r.Endpoint.Handler("", templates, inject.CopyInject{})
169 }
170}
171
172func TestRouteCollection(t *testing.T) {
173 var m = make(RouteCollection)

Callers

nothing calls this directly

Calls 2

newRouteFunction · 0.85
HandlerMethod · 0.65

Tested by

no test coverage detected