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

Function TestLoadWithStandalone

internal/descriptor/registry_test.go:491–508  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

489}
490
491func TestLoadWithStandalone(t *testing.T) {
492 reg := NewRegistry()
493 reg.SetStandalone(true)
494 loadFile(t, reg, `
495 name: 'example.proto'
496 package: 'example'
497 options < go_package: 'example.com/xyz;pb' >
498 `)
499 file := reg.files["example.proto"]
500 if file == nil {
501 t.Errorf("reg.files[%q] = nil; want non-nil", "example.proto")
502 return
503 }
504 wantPkg := GoPackage{Path: "example.com/xyz", Name: "pb", Alias: "extPb"}
505 if got, want := file.GoPkg, wantPkg; got != want {
506 t.Errorf("file.GoPkg = %#v; want %#v", got, want)
507 }
508}
509
510func TestUnboundExternalHTTPRules(t *testing.T) {
511 reg := NewRegistry()

Callers

nothing calls this directly

Calls 3

SetStandaloneMethod · 0.95
NewRegistryFunction · 0.85
loadFileFunction · 0.85

Tested by

no test coverage detected