MCPcopy
hub / github.com/grpc-ecosystem/grpc-gateway / TestServeMux_HandlePath

Function TestServeMux_HandlePath

runtime/mux_test.go:726–741  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

724}
725
726func TestServeMux_HandlePath(t *testing.T) {
727 mux := runtime.NewServeMux()
728 testFn := func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) {
729 }
730 for _, tt := range defaultRouteMatcherTests {
731 t.Run(tt.name, func(t *testing.T) {
732 err := mux.HandlePath(tt.method, tt.path, testFn)
733 if tt.valid && err != nil {
734 t.Errorf("The route %v with method %v and path %v invalid, got %v", tt.name, tt.method, tt.path, err)
735 }
736 if !tt.valid && err == nil {
737 t.Errorf("The route %v with method %v and path %v should be invalid", tt.name, tt.method, tt.path)
738 }
739 })
740 }
741}
742
743var healthCheckTests = []struct {
744 name string

Callers

nothing calls this directly

Calls 2

HandlePathMethod · 0.95
NewServeMuxFunction · 0.92

Tested by

no test coverage detected