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

Method TestParseWaitForReady

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

Source from the content-addressed store, hash-verified

191}
192
193func (s) TestParseWaitForReady(t *testing.T) {
194 testcases := []parseTestCase{
195 {
196 scjs: `{
197 "methodConfig": [
198 {
199 "name": [
200 {
201 "service": "foo",
202 "method": "Bar"
203 }
204 ],
205 "waitForReady": true
206 }
207 ]
208}`,
209 wantSC: &ServiceConfig{
210 Methods: map[string]MethodConfig{
211 "/foo/Bar": {
212 WaitForReady: newBool(true),
213 },
214 },
215 lbConfig: lbConfigFor(t, "", nil),
216 },
217 },
218 {
219 scjs: `{
220 "methodConfig": [
221 {
222 "name": [
223 {
224 "service": "foo",
225 "method": "Bar"
226 }
227 ],
228 "waitForReady": false
229 }
230 ]
231}`,
232 wantSC: &ServiceConfig{
233 Methods: map[string]MethodConfig{
234 "/foo/Bar": {
235 WaitForReady: newBool(false),
236 },
237 },
238 lbConfig: lbConfigFor(t, "", nil),
239 },
240 },
241 {
242 scjs: `{
243 "methodConfig": [
244 {
245 "name": [
246 {
247 "service": "foo",
248 "method": "Bar"
249 }
250 ],

Callers

nothing calls this directly

Calls 3

newBoolFunction · 0.85
lbConfigForFunction · 0.85
runParseTestsFunction · 0.85

Tested by

no test coverage detected