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

Function TestForwardEndpoint

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

Source from the content-addressed store, hash-verified

112}
113
114func TestForwardEndpoint(t *testing.T) {
115 f, err := newForwardEndpoint("http://foo")
116 if err != nil {
117 t.Errorf("Unexpected error: %s", err)
118 }
119 rb, err := rice.FindBox("templates")
120 if err != nil {
121 t.Error(err)
122 }
123 templates, err := ricetemp.MakeTemplates(rb)
124 if err != nil {
125 panic(err)
126 }
127
128 f.Handler("", templates, inject.CopyInject{})
129
130 f, err = newForwardEndpoint("%")
131 if err == nil {
132 t.Errorf("Expected error, got %s", f)
133 }
134}
135
136func TestNewRoute(t *testing.T) {
137 r, err := newRoute("foo=http://%", []string{})

Callers

nothing calls this directly

Calls 2

newForwardEndpointFunction · 0.85
HandlerMethod · 0.65

Tested by

no test coverage detected