MCPcopy
hub / github.com/grpc/grpc-go / TestParseDefaultMethodConfig

Method TestParseDefaultMethodConfig

service_config_test.go:400–455  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

398 runParseTests(t, testcases)
399}
400func (s) TestParseDefaultMethodConfig(t *testing.T) {
401 dc := &ServiceConfig{
402 Methods: map[string]MethodConfig{
403 "": {WaitForReady: newBool(true)},
404 },
405 lbConfig: lbConfigFor(t, "", nil),
406 }
407
408 runParseTests(t, []parseTestCase{
409 {
410 scjs: `{
411 "methodConfig": [{
412 "name": [{}],
413 "waitForReady": true
414 }]
415}`,
416 wantSC: dc,
417 },
418 {
419 scjs: `{
420 "methodConfig": [{
421 "name": [{"service": null}],
422 "waitForReady": true
423 }]
424}`,
425 wantSC: dc,
426 },
427 {
428 scjs: `{
429 "methodConfig": [{
430 "name": [{"service": ""}],
431 "waitForReady": true
432 }]
433}`,
434 wantSC: dc,
435 },
436 {
437 scjs: `{
438 "methodConfig": [{
439 "name": [{"method": "Bar"}],
440 "waitForReady": true
441 }]
442}`,
443 wantErr: true,
444 },
445 {
446 scjs: `{
447 "methodConfig": [{
448 "name": [{"service": "", "method": "Bar"}],
449 "waitForReady": true
450 }]
451}`,
452 wantErr: true,
453 },
454 })
455}
456
457func (s) TestParseMethodConfigDuplicatedName(t *testing.T) {

Callers

nothing calls this directly

Calls 3

newBoolFunction · 0.85
lbConfigForFunction · 0.85
runParseTestsFunction · 0.85

Tested by

no test coverage detected