(t *testing.T)
| 269 | } |
| 270 | |
| 271 | func (s) TestParseTimeOut(t *testing.T) { |
| 272 | testcases := []parseTestCase{ |
| 273 | { |
| 274 | scjs: `{ |
| 275 | "methodConfig": [ |
| 276 | { |
| 277 | "name": [ |
| 278 | { |
| 279 | "service": "foo", |
| 280 | "method": "Bar" |
| 281 | } |
| 282 | ], |
| 283 | "timeout": "1s" |
| 284 | } |
| 285 | ] |
| 286 | }`, |
| 287 | wantSC: &ServiceConfig{ |
| 288 | Methods: map[string]MethodConfig{ |
| 289 | "/foo/Bar": { |
| 290 | Timeout: newDuration(time.Second), |
| 291 | }, |
| 292 | }, |
| 293 | lbConfig: lbConfigFor(t, "", nil), |
| 294 | }, |
| 295 | }, |
| 296 | { |
| 297 | scjs: `{ |
| 298 | "methodConfig": [ |
| 299 | { |
| 300 | "name": [ |
| 301 | { |
| 302 | "service": "foo", |
| 303 | "method": "Bar" |
| 304 | } |
| 305 | ], |
| 306 | "timeout": "3c" |
| 307 | } |
| 308 | ] |
| 309 | }`, |
| 310 | wantErr: true, |
| 311 | }, |
| 312 | { |
| 313 | scjs: `{ |
| 314 | "methodConfig": [ |
| 315 | { |
| 316 | "name": [ |
| 317 | { |
| 318 | "service": "foo", |
| 319 | "method": "Bar" |
| 320 | } |
| 321 | ], |
| 322 | "timeout": "3c" |
| 323 | }, |
| 324 | { |
| 325 | "name": [ |
| 326 | { |
| 327 | "service": "foo", |
| 328 | "method": "Bar" |
nothing calls this directly
no test coverage detected