OLD | NEW |
1 library googleapis_beta.autoscaler.v1beta2.test; | 1 library googleapis_beta.autoscaler.v1beta2.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
11 import 'package:googleapis_beta/common/common.dart' as common; | |
12 import 'package:googleapis_beta/src/common_internal.dart' as common_internal; | |
13 import '../common/common_internal_test.dart' as common_test; | |
14 | 11 |
15 import 'package:googleapis_beta/autoscaler/v1beta2.dart' as api; | 12 import 'package:googleapis_beta/autoscaler/v1beta2.dart' as api; |
16 | 13 |
| 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; |
| 16 core.bool _expectJson; |
17 | 17 |
| 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; |
| 20 _expectJson = expectJson; |
| 21 } |
| 22 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { |
| 25 return request.finalize() |
| 26 .transform(convert.UTF8.decoder) |
| 27 .join('') |
| 28 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); |
| 31 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } |
| 34 }); |
| 35 } else { |
| 36 var stream = request.finalize(); |
| 37 if (stream == null) { |
| 38 return _callback(request, []); |
| 39 } else { |
| 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); |
| 42 }); |
| 43 } |
| 44 } |
| 45 } |
| 46 } |
| 47 |
| 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } |
18 | 53 |
19 core.int buildCounterAutoscaler = 0; | 54 core.int buildCounterAutoscaler = 0; |
20 buildAutoscaler() { | 55 buildAutoscaler() { |
21 var o = new api.Autoscaler(); | 56 var o = new api.Autoscaler(); |
22 buildCounterAutoscaler++; | 57 buildCounterAutoscaler++; |
23 if (buildCounterAutoscaler < 3) { | 58 if (buildCounterAutoscaler < 3) { |
24 o.autoscalingPolicy = buildAutoscalingPolicy(); | 59 o.autoscalingPolicy = buildAutoscalingPolicy(); |
25 o.creationTimestamp = "foo"; | 60 o.creationTimestamp = "foo"; |
26 o.description = "foo"; | 61 o.description = "foo"; |
27 o.id = "foo"; | 62 o.id = "foo"; |
(...skipping 14 matching lines...) Expand all Loading... |
42 unittest.expect(o.description, unittest.equals('foo')); | 77 unittest.expect(o.description, unittest.equals('foo')); |
43 unittest.expect(o.id, unittest.equals('foo')); | 78 unittest.expect(o.id, unittest.equals('foo')); |
44 unittest.expect(o.kind, unittest.equals('foo')); | 79 unittest.expect(o.kind, unittest.equals('foo')); |
45 unittest.expect(o.name, unittest.equals('foo')); | 80 unittest.expect(o.name, unittest.equals('foo')); |
46 unittest.expect(o.selfLink, unittest.equals('foo')); | 81 unittest.expect(o.selfLink, unittest.equals('foo')); |
47 unittest.expect(o.target, unittest.equals('foo')); | 82 unittest.expect(o.target, unittest.equals('foo')); |
48 } | 83 } |
49 buildCounterAutoscaler--; | 84 buildCounterAutoscaler--; |
50 } | 85 } |
51 | 86 |
52 buildUnnamed1687() { | 87 buildUnnamed1467() { |
53 var o = new core.List<api.Autoscaler>(); | 88 var o = new core.List<api.Autoscaler>(); |
54 o.add(buildAutoscaler()); | 89 o.add(buildAutoscaler()); |
55 o.add(buildAutoscaler()); | 90 o.add(buildAutoscaler()); |
56 return o; | 91 return o; |
57 } | 92 } |
58 | 93 |
59 checkUnnamed1687(core.List<api.Autoscaler> o) { | 94 checkUnnamed1467(core.List<api.Autoscaler> o) { |
60 unittest.expect(o, unittest.hasLength(2)); | 95 unittest.expect(o, unittest.hasLength(2)); |
61 checkAutoscaler(o[0]); | 96 checkAutoscaler(o[0]); |
62 checkAutoscaler(o[1]); | 97 checkAutoscaler(o[1]); |
63 } | 98 } |
64 | 99 |
65 core.int buildCounterAutoscalerListResponse = 0; | 100 core.int buildCounterAutoscalerListResponse = 0; |
66 buildAutoscalerListResponse() { | 101 buildAutoscalerListResponse() { |
67 var o = new api.AutoscalerListResponse(); | 102 var o = new api.AutoscalerListResponse(); |
68 buildCounterAutoscalerListResponse++; | 103 buildCounterAutoscalerListResponse++; |
69 if (buildCounterAutoscalerListResponse < 3) { | 104 if (buildCounterAutoscalerListResponse < 3) { |
70 o.items = buildUnnamed1687(); | 105 o.items = buildUnnamed1467(); |
71 o.kind = "foo"; | 106 o.kind = "foo"; |
72 o.nextPageToken = "foo"; | 107 o.nextPageToken = "foo"; |
73 } | 108 } |
74 buildCounterAutoscalerListResponse--; | 109 buildCounterAutoscalerListResponse--; |
75 return o; | 110 return o; |
76 } | 111 } |
77 | 112 |
78 checkAutoscalerListResponse(api.AutoscalerListResponse o) { | 113 checkAutoscalerListResponse(api.AutoscalerListResponse o) { |
79 buildCounterAutoscalerListResponse++; | 114 buildCounterAutoscalerListResponse++; |
80 if (buildCounterAutoscalerListResponse < 3) { | 115 if (buildCounterAutoscalerListResponse < 3) { |
81 checkUnnamed1687(o.items); | 116 checkUnnamed1467(o.items); |
82 unittest.expect(o.kind, unittest.equals('foo')); | 117 unittest.expect(o.kind, unittest.equals('foo')); |
83 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 118 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
84 } | 119 } |
85 buildCounterAutoscalerListResponse--; | 120 buildCounterAutoscalerListResponse--; |
86 } | 121 } |
87 | 122 |
88 buildUnnamed1688() { | 123 buildUnnamed1468() { |
89 var o = new core.List<api.AutoscalingPolicyCustomMetricUtilization>(); | 124 var o = new core.List<api.AutoscalingPolicyCustomMetricUtilization>(); |
90 o.add(buildAutoscalingPolicyCustomMetricUtilization()); | 125 o.add(buildAutoscalingPolicyCustomMetricUtilization()); |
91 o.add(buildAutoscalingPolicyCustomMetricUtilization()); | 126 o.add(buildAutoscalingPolicyCustomMetricUtilization()); |
92 return o; | 127 return o; |
93 } | 128 } |
94 | 129 |
95 checkUnnamed1688(core.List<api.AutoscalingPolicyCustomMetricUtilization> o) { | 130 checkUnnamed1468(core.List<api.AutoscalingPolicyCustomMetricUtilization> o) { |
96 unittest.expect(o, unittest.hasLength(2)); | 131 unittest.expect(o, unittest.hasLength(2)); |
97 checkAutoscalingPolicyCustomMetricUtilization(o[0]); | 132 checkAutoscalingPolicyCustomMetricUtilization(o[0]); |
98 checkAutoscalingPolicyCustomMetricUtilization(o[1]); | 133 checkAutoscalingPolicyCustomMetricUtilization(o[1]); |
99 } | 134 } |
100 | 135 |
101 core.int buildCounterAutoscalingPolicy = 0; | 136 core.int buildCounterAutoscalingPolicy = 0; |
102 buildAutoscalingPolicy() { | 137 buildAutoscalingPolicy() { |
103 var o = new api.AutoscalingPolicy(); | 138 var o = new api.AutoscalingPolicy(); |
104 buildCounterAutoscalingPolicy++; | 139 buildCounterAutoscalingPolicy++; |
105 if (buildCounterAutoscalingPolicy < 3) { | 140 if (buildCounterAutoscalingPolicy < 3) { |
106 o.coolDownPeriodSec = 42; | 141 o.coolDownPeriodSec = 42; |
107 o.cpuUtilization = buildAutoscalingPolicyCpuUtilization(); | 142 o.cpuUtilization = buildAutoscalingPolicyCpuUtilization(); |
108 o.customMetricUtilizations = buildUnnamed1688(); | 143 o.customMetricUtilizations = buildUnnamed1468(); |
109 o.loadBalancingUtilization = buildAutoscalingPolicyLoadBalancingUtilization(
); | 144 o.loadBalancingUtilization = buildAutoscalingPolicyLoadBalancingUtilization(
); |
110 o.maxNumReplicas = 42; | 145 o.maxNumReplicas = 42; |
111 o.minNumReplicas = 42; | 146 o.minNumReplicas = 42; |
112 } | 147 } |
113 buildCounterAutoscalingPolicy--; | 148 buildCounterAutoscalingPolicy--; |
114 return o; | 149 return o; |
115 } | 150 } |
116 | 151 |
117 checkAutoscalingPolicy(api.AutoscalingPolicy o) { | 152 checkAutoscalingPolicy(api.AutoscalingPolicy o) { |
118 buildCounterAutoscalingPolicy++; | 153 buildCounterAutoscalingPolicy++; |
119 if (buildCounterAutoscalingPolicy < 3) { | 154 if (buildCounterAutoscalingPolicy < 3) { |
120 unittest.expect(o.coolDownPeriodSec, unittest.equals(42)); | 155 unittest.expect(o.coolDownPeriodSec, unittest.equals(42)); |
121 checkAutoscalingPolicyCpuUtilization(o.cpuUtilization); | 156 checkAutoscalingPolicyCpuUtilization(o.cpuUtilization); |
122 checkUnnamed1688(o.customMetricUtilizations); | 157 checkUnnamed1468(o.customMetricUtilizations); |
123 checkAutoscalingPolicyLoadBalancingUtilization(o.loadBalancingUtilization); | 158 checkAutoscalingPolicyLoadBalancingUtilization(o.loadBalancingUtilization); |
124 unittest.expect(o.maxNumReplicas, unittest.equals(42)); | 159 unittest.expect(o.maxNumReplicas, unittest.equals(42)); |
125 unittest.expect(o.minNumReplicas, unittest.equals(42)); | 160 unittest.expect(o.minNumReplicas, unittest.equals(42)); |
126 } | 161 } |
127 buildCounterAutoscalingPolicy--; | 162 buildCounterAutoscalingPolicy--; |
128 } | 163 } |
129 | 164 |
130 core.int buildCounterAutoscalingPolicyCpuUtilization = 0; | 165 core.int buildCounterAutoscalingPolicyCpuUtilization = 0; |
131 buildAutoscalingPolicyCpuUtilization() { | 166 buildAutoscalingPolicyCpuUtilization() { |
132 var o = new api.AutoscalingPolicyCpuUtilization(); | 167 var o = new api.AutoscalingPolicyCpuUtilization(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 checkOperationErrorErrors(api.OperationErrorErrors o) { | 266 checkOperationErrorErrors(api.OperationErrorErrors o) { |
232 buildCounterOperationErrorErrors++; | 267 buildCounterOperationErrorErrors++; |
233 if (buildCounterOperationErrorErrors < 3) { | 268 if (buildCounterOperationErrorErrors < 3) { |
234 unittest.expect(o.code, unittest.equals('foo')); | 269 unittest.expect(o.code, unittest.equals('foo')); |
235 unittest.expect(o.location, unittest.equals('foo')); | 270 unittest.expect(o.location, unittest.equals('foo')); |
236 unittest.expect(o.message, unittest.equals('foo')); | 271 unittest.expect(o.message, unittest.equals('foo')); |
237 } | 272 } |
238 buildCounterOperationErrorErrors--; | 273 buildCounterOperationErrorErrors--; |
239 } | 274 } |
240 | 275 |
241 buildUnnamed1689() { | 276 buildUnnamed1469() { |
242 var o = new core.List<api.OperationErrorErrors>(); | 277 var o = new core.List<api.OperationErrorErrors>(); |
243 o.add(buildOperationErrorErrors()); | 278 o.add(buildOperationErrorErrors()); |
244 o.add(buildOperationErrorErrors()); | 279 o.add(buildOperationErrorErrors()); |
245 return o; | 280 return o; |
246 } | 281 } |
247 | 282 |
248 checkUnnamed1689(core.List<api.OperationErrorErrors> o) { | 283 checkUnnamed1469(core.List<api.OperationErrorErrors> o) { |
249 unittest.expect(o, unittest.hasLength(2)); | 284 unittest.expect(o, unittest.hasLength(2)); |
250 checkOperationErrorErrors(o[0]); | 285 checkOperationErrorErrors(o[0]); |
251 checkOperationErrorErrors(o[1]); | 286 checkOperationErrorErrors(o[1]); |
252 } | 287 } |
253 | 288 |
254 core.int buildCounterOperationError = 0; | 289 core.int buildCounterOperationError = 0; |
255 buildOperationError() { | 290 buildOperationError() { |
256 var o = new api.OperationError(); | 291 var o = new api.OperationError(); |
257 buildCounterOperationError++; | 292 buildCounterOperationError++; |
258 if (buildCounterOperationError < 3) { | 293 if (buildCounterOperationError < 3) { |
259 o.errors = buildUnnamed1689(); | 294 o.errors = buildUnnamed1469(); |
260 } | 295 } |
261 buildCounterOperationError--; | 296 buildCounterOperationError--; |
262 return o; | 297 return o; |
263 } | 298 } |
264 | 299 |
265 checkOperationError(api.OperationError o) { | 300 checkOperationError(api.OperationError o) { |
266 buildCounterOperationError++; | 301 buildCounterOperationError++; |
267 if (buildCounterOperationError < 3) { | 302 if (buildCounterOperationError < 3) { |
268 checkUnnamed1689(o.errors); | 303 checkUnnamed1469(o.errors); |
269 } | 304 } |
270 buildCounterOperationError--; | 305 buildCounterOperationError--; |
271 } | 306 } |
272 | 307 |
273 core.int buildCounterOperationWarningsData = 0; | 308 core.int buildCounterOperationWarningsData = 0; |
274 buildOperationWarningsData() { | 309 buildOperationWarningsData() { |
275 var o = new api.OperationWarningsData(); | 310 var o = new api.OperationWarningsData(); |
276 buildCounterOperationWarningsData++; | 311 buildCounterOperationWarningsData++; |
277 if (buildCounterOperationWarningsData < 3) { | 312 if (buildCounterOperationWarningsData < 3) { |
278 o.key = "foo"; | 313 o.key = "foo"; |
279 o.value = "foo"; | 314 o.value = "foo"; |
280 } | 315 } |
281 buildCounterOperationWarningsData--; | 316 buildCounterOperationWarningsData--; |
282 return o; | 317 return o; |
283 } | 318 } |
284 | 319 |
285 checkOperationWarningsData(api.OperationWarningsData o) { | 320 checkOperationWarningsData(api.OperationWarningsData o) { |
286 buildCounterOperationWarningsData++; | 321 buildCounterOperationWarningsData++; |
287 if (buildCounterOperationWarningsData < 3) { | 322 if (buildCounterOperationWarningsData < 3) { |
288 unittest.expect(o.key, unittest.equals('foo')); | 323 unittest.expect(o.key, unittest.equals('foo')); |
289 unittest.expect(o.value, unittest.equals('foo')); | 324 unittest.expect(o.value, unittest.equals('foo')); |
290 } | 325 } |
291 buildCounterOperationWarningsData--; | 326 buildCounterOperationWarningsData--; |
292 } | 327 } |
293 | 328 |
294 buildUnnamed1690() { | 329 buildUnnamed1470() { |
295 var o = new core.List<api.OperationWarningsData>(); | 330 var o = new core.List<api.OperationWarningsData>(); |
296 o.add(buildOperationWarningsData()); | 331 o.add(buildOperationWarningsData()); |
297 o.add(buildOperationWarningsData()); | 332 o.add(buildOperationWarningsData()); |
298 return o; | 333 return o; |
299 } | 334 } |
300 | 335 |
301 checkUnnamed1690(core.List<api.OperationWarningsData> o) { | 336 checkUnnamed1470(core.List<api.OperationWarningsData> o) { |
302 unittest.expect(o, unittest.hasLength(2)); | 337 unittest.expect(o, unittest.hasLength(2)); |
303 checkOperationWarningsData(o[0]); | 338 checkOperationWarningsData(o[0]); |
304 checkOperationWarningsData(o[1]); | 339 checkOperationWarningsData(o[1]); |
305 } | 340 } |
306 | 341 |
307 core.int buildCounterOperationWarnings = 0; | 342 core.int buildCounterOperationWarnings = 0; |
308 buildOperationWarnings() { | 343 buildOperationWarnings() { |
309 var o = new api.OperationWarnings(); | 344 var o = new api.OperationWarnings(); |
310 buildCounterOperationWarnings++; | 345 buildCounterOperationWarnings++; |
311 if (buildCounterOperationWarnings < 3) { | 346 if (buildCounterOperationWarnings < 3) { |
312 o.code = "foo"; | 347 o.code = "foo"; |
313 o.data = buildUnnamed1690(); | 348 o.data = buildUnnamed1470(); |
314 o.message = "foo"; | 349 o.message = "foo"; |
315 } | 350 } |
316 buildCounterOperationWarnings--; | 351 buildCounterOperationWarnings--; |
317 return o; | 352 return o; |
318 } | 353 } |
319 | 354 |
320 checkOperationWarnings(api.OperationWarnings o) { | 355 checkOperationWarnings(api.OperationWarnings o) { |
321 buildCounterOperationWarnings++; | 356 buildCounterOperationWarnings++; |
322 if (buildCounterOperationWarnings < 3) { | 357 if (buildCounterOperationWarnings < 3) { |
323 unittest.expect(o.code, unittest.equals('foo')); | 358 unittest.expect(o.code, unittest.equals('foo')); |
324 checkUnnamed1690(o.data); | 359 checkUnnamed1470(o.data); |
325 unittest.expect(o.message, unittest.equals('foo')); | 360 unittest.expect(o.message, unittest.equals('foo')); |
326 } | 361 } |
327 buildCounterOperationWarnings--; | 362 buildCounterOperationWarnings--; |
328 } | 363 } |
329 | 364 |
330 buildUnnamed1691() { | 365 buildUnnamed1471() { |
331 var o = new core.List<api.OperationWarnings>(); | 366 var o = new core.List<api.OperationWarnings>(); |
332 o.add(buildOperationWarnings()); | 367 o.add(buildOperationWarnings()); |
333 o.add(buildOperationWarnings()); | 368 o.add(buildOperationWarnings()); |
334 return o; | 369 return o; |
335 } | 370 } |
336 | 371 |
337 checkUnnamed1691(core.List<api.OperationWarnings> o) { | 372 checkUnnamed1471(core.List<api.OperationWarnings> o) { |
338 unittest.expect(o, unittest.hasLength(2)); | 373 unittest.expect(o, unittest.hasLength(2)); |
339 checkOperationWarnings(o[0]); | 374 checkOperationWarnings(o[0]); |
340 checkOperationWarnings(o[1]); | 375 checkOperationWarnings(o[1]); |
341 } | 376 } |
342 | 377 |
343 core.int buildCounterOperation = 0; | 378 core.int buildCounterOperation = 0; |
344 buildOperation() { | 379 buildOperation() { |
345 var o = new api.Operation(); | 380 var o = new api.Operation(); |
346 buildCounterOperation++; | 381 buildCounterOperation++; |
347 if (buildCounterOperation < 3) { | 382 if (buildCounterOperation < 3) { |
(...skipping 10 matching lines...) Expand all Loading... |
358 o.operationType = "foo"; | 393 o.operationType = "foo"; |
359 o.progress = 42; | 394 o.progress = 42; |
360 o.region = "foo"; | 395 o.region = "foo"; |
361 o.selfLink = "foo"; | 396 o.selfLink = "foo"; |
362 o.startTime = "foo"; | 397 o.startTime = "foo"; |
363 o.status = "foo"; | 398 o.status = "foo"; |
364 o.statusMessage = "foo"; | 399 o.statusMessage = "foo"; |
365 o.targetId = "foo"; | 400 o.targetId = "foo"; |
366 o.targetLink = "foo"; | 401 o.targetLink = "foo"; |
367 o.user = "foo"; | 402 o.user = "foo"; |
368 o.warnings = buildUnnamed1691(); | 403 o.warnings = buildUnnamed1471(); |
369 o.zone = "foo"; | 404 o.zone = "foo"; |
370 } | 405 } |
371 buildCounterOperation--; | 406 buildCounterOperation--; |
372 return o; | 407 return o; |
373 } | 408 } |
374 | 409 |
375 checkOperation(api.Operation o) { | 410 checkOperation(api.Operation o) { |
376 buildCounterOperation++; | 411 buildCounterOperation++; |
377 if (buildCounterOperation < 3) { | 412 if (buildCounterOperation < 3) { |
378 unittest.expect(o.clientOperationId, unittest.equals('foo')); | 413 unittest.expect(o.clientOperationId, unittest.equals('foo')); |
379 unittest.expect(o.creationTimestamp, unittest.equals('foo')); | 414 unittest.expect(o.creationTimestamp, unittest.equals('foo')); |
380 unittest.expect(o.endTime, unittest.equals('foo')); | 415 unittest.expect(o.endTime, unittest.equals('foo')); |
381 checkOperationError(o.error); | 416 checkOperationError(o.error); |
382 unittest.expect(o.httpErrorMessage, unittest.equals('foo')); | 417 unittest.expect(o.httpErrorMessage, unittest.equals('foo')); |
383 unittest.expect(o.httpErrorStatusCode, unittest.equals(42)); | 418 unittest.expect(o.httpErrorStatusCode, unittest.equals(42)); |
384 unittest.expect(o.id, unittest.equals('foo')); | 419 unittest.expect(o.id, unittest.equals('foo')); |
385 unittest.expect(o.insertTime, unittest.equals('foo')); | 420 unittest.expect(o.insertTime, unittest.equals('foo')); |
386 unittest.expect(o.kind, unittest.equals('foo')); | 421 unittest.expect(o.kind, unittest.equals('foo')); |
387 unittest.expect(o.name, unittest.equals('foo')); | 422 unittest.expect(o.name, unittest.equals('foo')); |
388 unittest.expect(o.operationType, unittest.equals('foo')); | 423 unittest.expect(o.operationType, unittest.equals('foo')); |
389 unittest.expect(o.progress, unittest.equals(42)); | 424 unittest.expect(o.progress, unittest.equals(42)); |
390 unittest.expect(o.region, unittest.equals('foo')); | 425 unittest.expect(o.region, unittest.equals('foo')); |
391 unittest.expect(o.selfLink, unittest.equals('foo')); | 426 unittest.expect(o.selfLink, unittest.equals('foo')); |
392 unittest.expect(o.startTime, unittest.equals('foo')); | 427 unittest.expect(o.startTime, unittest.equals('foo')); |
393 unittest.expect(o.status, unittest.equals('foo')); | 428 unittest.expect(o.status, unittest.equals('foo')); |
394 unittest.expect(o.statusMessage, unittest.equals('foo')); | 429 unittest.expect(o.statusMessage, unittest.equals('foo')); |
395 unittest.expect(o.targetId, unittest.equals('foo')); | 430 unittest.expect(o.targetId, unittest.equals('foo')); |
396 unittest.expect(o.targetLink, unittest.equals('foo')); | 431 unittest.expect(o.targetLink, unittest.equals('foo')); |
397 unittest.expect(o.user, unittest.equals('foo')); | 432 unittest.expect(o.user, unittest.equals('foo')); |
398 checkUnnamed1691(o.warnings); | 433 checkUnnamed1471(o.warnings); |
399 unittest.expect(o.zone, unittest.equals('foo')); | 434 unittest.expect(o.zone, unittest.equals('foo')); |
400 } | 435 } |
401 buildCounterOperation--; | 436 buildCounterOperation--; |
402 } | 437 } |
403 | 438 |
404 buildUnnamed1692() { | 439 buildUnnamed1472() { |
405 var o = new core.List<api.Operation>(); | 440 var o = new core.List<api.Operation>(); |
406 o.add(buildOperation()); | 441 o.add(buildOperation()); |
407 o.add(buildOperation()); | 442 o.add(buildOperation()); |
408 return o; | 443 return o; |
409 } | 444 } |
410 | 445 |
411 checkUnnamed1692(core.List<api.Operation> o) { | 446 checkUnnamed1472(core.List<api.Operation> o) { |
412 unittest.expect(o, unittest.hasLength(2)); | 447 unittest.expect(o, unittest.hasLength(2)); |
413 checkOperation(o[0]); | 448 checkOperation(o[0]); |
414 checkOperation(o[1]); | 449 checkOperation(o[1]); |
415 } | 450 } |
416 | 451 |
417 core.int buildCounterOperationList = 0; | 452 core.int buildCounterOperationList = 0; |
418 buildOperationList() { | 453 buildOperationList() { |
419 var o = new api.OperationList(); | 454 var o = new api.OperationList(); |
420 buildCounterOperationList++; | 455 buildCounterOperationList++; |
421 if (buildCounterOperationList < 3) { | 456 if (buildCounterOperationList < 3) { |
422 o.id = "foo"; | 457 o.id = "foo"; |
423 o.items = buildUnnamed1692(); | 458 o.items = buildUnnamed1472(); |
424 o.kind = "foo"; | 459 o.kind = "foo"; |
425 o.nextPageToken = "foo"; | 460 o.nextPageToken = "foo"; |
426 o.selfLink = "foo"; | 461 o.selfLink = "foo"; |
427 } | 462 } |
428 buildCounterOperationList--; | 463 buildCounterOperationList--; |
429 return o; | 464 return o; |
430 } | 465 } |
431 | 466 |
432 checkOperationList(api.OperationList o) { | 467 checkOperationList(api.OperationList o) { |
433 buildCounterOperationList++; | 468 buildCounterOperationList++; |
434 if (buildCounterOperationList < 3) { | 469 if (buildCounterOperationList < 3) { |
435 unittest.expect(o.id, unittest.equals('foo')); | 470 unittest.expect(o.id, unittest.equals('foo')); |
436 checkUnnamed1692(o.items); | 471 checkUnnamed1472(o.items); |
437 unittest.expect(o.kind, unittest.equals('foo')); | 472 unittest.expect(o.kind, unittest.equals('foo')); |
438 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 473 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
439 unittest.expect(o.selfLink, unittest.equals('foo')); | 474 unittest.expect(o.selfLink, unittest.equals('foo')); |
440 } | 475 } |
441 buildCounterOperationList--; | 476 buildCounterOperationList--; |
442 } | 477 } |
443 | 478 |
444 core.int buildCounterZoneMaintenanceWindows = 0; | 479 core.int buildCounterZoneMaintenanceWindows = 0; |
445 buildZoneMaintenanceWindows() { | 480 buildZoneMaintenanceWindows() { |
446 var o = new api.ZoneMaintenanceWindows(); | 481 var o = new api.ZoneMaintenanceWindows(); |
(...skipping 12 matching lines...) Expand all Loading... |
459 buildCounterZoneMaintenanceWindows++; | 494 buildCounterZoneMaintenanceWindows++; |
460 if (buildCounterZoneMaintenanceWindows < 3) { | 495 if (buildCounterZoneMaintenanceWindows < 3) { |
461 unittest.expect(o.beginTime, unittest.equals('foo')); | 496 unittest.expect(o.beginTime, unittest.equals('foo')); |
462 unittest.expect(o.description, unittest.equals('foo')); | 497 unittest.expect(o.description, unittest.equals('foo')); |
463 unittest.expect(o.endTime, unittest.equals('foo')); | 498 unittest.expect(o.endTime, unittest.equals('foo')); |
464 unittest.expect(o.name, unittest.equals('foo')); | 499 unittest.expect(o.name, unittest.equals('foo')); |
465 } | 500 } |
466 buildCounterZoneMaintenanceWindows--; | 501 buildCounterZoneMaintenanceWindows--; |
467 } | 502 } |
468 | 503 |
469 buildUnnamed1693() { | 504 buildUnnamed1473() { |
470 var o = new core.List<api.ZoneMaintenanceWindows>(); | 505 var o = new core.List<api.ZoneMaintenanceWindows>(); |
471 o.add(buildZoneMaintenanceWindows()); | 506 o.add(buildZoneMaintenanceWindows()); |
472 o.add(buildZoneMaintenanceWindows()); | 507 o.add(buildZoneMaintenanceWindows()); |
473 return o; | 508 return o; |
474 } | 509 } |
475 | 510 |
476 checkUnnamed1693(core.List<api.ZoneMaintenanceWindows> o) { | 511 checkUnnamed1473(core.List<api.ZoneMaintenanceWindows> o) { |
477 unittest.expect(o, unittest.hasLength(2)); | 512 unittest.expect(o, unittest.hasLength(2)); |
478 checkZoneMaintenanceWindows(o[0]); | 513 checkZoneMaintenanceWindows(o[0]); |
479 checkZoneMaintenanceWindows(o[1]); | 514 checkZoneMaintenanceWindows(o[1]); |
480 } | 515 } |
481 | 516 |
482 core.int buildCounterZone = 0; | 517 core.int buildCounterZone = 0; |
483 buildZone() { | 518 buildZone() { |
484 var o = new api.Zone(); | 519 var o = new api.Zone(); |
485 buildCounterZone++; | 520 buildCounterZone++; |
486 if (buildCounterZone < 3) { | 521 if (buildCounterZone < 3) { |
487 o.creationTimestamp = "foo"; | 522 o.creationTimestamp = "foo"; |
488 o.deprecated = buildDeprecationStatus(); | 523 o.deprecated = buildDeprecationStatus(); |
489 o.description = "foo"; | 524 o.description = "foo"; |
490 o.id = "foo"; | 525 o.id = "foo"; |
491 o.kind = "foo"; | 526 o.kind = "foo"; |
492 o.maintenanceWindows = buildUnnamed1693(); | 527 o.maintenanceWindows = buildUnnamed1473(); |
493 o.name = "foo"; | 528 o.name = "foo"; |
494 o.region = "foo"; | 529 o.region = "foo"; |
495 o.selfLink = "foo"; | 530 o.selfLink = "foo"; |
496 o.status = "foo"; | 531 o.status = "foo"; |
497 } | 532 } |
498 buildCounterZone--; | 533 buildCounterZone--; |
499 return o; | 534 return o; |
500 } | 535 } |
501 | 536 |
502 checkZone(api.Zone o) { | 537 checkZone(api.Zone o) { |
503 buildCounterZone++; | 538 buildCounterZone++; |
504 if (buildCounterZone < 3) { | 539 if (buildCounterZone < 3) { |
505 unittest.expect(o.creationTimestamp, unittest.equals('foo')); | 540 unittest.expect(o.creationTimestamp, unittest.equals('foo')); |
506 checkDeprecationStatus(o.deprecated); | 541 checkDeprecationStatus(o.deprecated); |
507 unittest.expect(o.description, unittest.equals('foo')); | 542 unittest.expect(o.description, unittest.equals('foo')); |
508 unittest.expect(o.id, unittest.equals('foo')); | 543 unittest.expect(o.id, unittest.equals('foo')); |
509 unittest.expect(o.kind, unittest.equals('foo')); | 544 unittest.expect(o.kind, unittest.equals('foo')); |
510 checkUnnamed1693(o.maintenanceWindows); | 545 checkUnnamed1473(o.maintenanceWindows); |
511 unittest.expect(o.name, unittest.equals('foo')); | 546 unittest.expect(o.name, unittest.equals('foo')); |
512 unittest.expect(o.region, unittest.equals('foo')); | 547 unittest.expect(o.region, unittest.equals('foo')); |
513 unittest.expect(o.selfLink, unittest.equals('foo')); | 548 unittest.expect(o.selfLink, unittest.equals('foo')); |
514 unittest.expect(o.status, unittest.equals('foo')); | 549 unittest.expect(o.status, unittest.equals('foo')); |
515 } | 550 } |
516 buildCounterZone--; | 551 buildCounterZone--; |
517 } | 552 } |
518 | 553 |
519 buildUnnamed1694() { | 554 buildUnnamed1474() { |
520 var o = new core.List<api.Zone>(); | 555 var o = new core.List<api.Zone>(); |
521 o.add(buildZone()); | 556 o.add(buildZone()); |
522 o.add(buildZone()); | 557 o.add(buildZone()); |
523 return o; | 558 return o; |
524 } | 559 } |
525 | 560 |
526 checkUnnamed1694(core.List<api.Zone> o) { | 561 checkUnnamed1474(core.List<api.Zone> o) { |
527 unittest.expect(o, unittest.hasLength(2)); | 562 unittest.expect(o, unittest.hasLength(2)); |
528 checkZone(o[0]); | 563 checkZone(o[0]); |
529 checkZone(o[1]); | 564 checkZone(o[1]); |
530 } | 565 } |
531 | 566 |
532 core.int buildCounterZoneList = 0; | 567 core.int buildCounterZoneList = 0; |
533 buildZoneList() { | 568 buildZoneList() { |
534 var o = new api.ZoneList(); | 569 var o = new api.ZoneList(); |
535 buildCounterZoneList++; | 570 buildCounterZoneList++; |
536 if (buildCounterZoneList < 3) { | 571 if (buildCounterZoneList < 3) { |
537 o.id = "foo"; | 572 o.id = "foo"; |
538 o.items = buildUnnamed1694(); | 573 o.items = buildUnnamed1474(); |
539 o.kind = "foo"; | 574 o.kind = "foo"; |
540 o.nextPageToken = "foo"; | 575 o.nextPageToken = "foo"; |
541 o.selfLink = "foo"; | 576 o.selfLink = "foo"; |
542 } | 577 } |
543 buildCounterZoneList--; | 578 buildCounterZoneList--; |
544 return o; | 579 return o; |
545 } | 580 } |
546 | 581 |
547 checkZoneList(api.ZoneList o) { | 582 checkZoneList(api.ZoneList o) { |
548 buildCounterZoneList++; | 583 buildCounterZoneList++; |
549 if (buildCounterZoneList < 3) { | 584 if (buildCounterZoneList < 3) { |
550 unittest.expect(o.id, unittest.equals('foo')); | 585 unittest.expect(o.id, unittest.equals('foo')); |
551 checkUnnamed1694(o.items); | 586 checkUnnamed1474(o.items); |
552 unittest.expect(o.kind, unittest.equals('foo')); | 587 unittest.expect(o.kind, unittest.equals('foo')); |
553 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 588 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
554 unittest.expect(o.selfLink, unittest.equals('foo')); | 589 unittest.expect(o.selfLink, unittest.equals('foo')); |
555 } | 590 } |
556 buildCounterZoneList--; | 591 buildCounterZoneList--; |
557 } | 592 } |
558 | 593 |
559 | 594 |
560 main() { | 595 main() { |
561 unittest.group("obj-schema-Autoscaler", () { | 596 unittest.group("obj-schema-Autoscaler", () { |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 var o = buildZoneList(); | 733 var o = buildZoneList(); |
699 var od = new api.ZoneList.fromJson(o.toJson()); | 734 var od = new api.ZoneList.fromJson(o.toJson()); |
700 checkZoneList(od); | 735 checkZoneList(od); |
701 }); | 736 }); |
702 }); | 737 }); |
703 | 738 |
704 | 739 |
705 unittest.group("resource-AutoscalersResourceApi", () { | 740 unittest.group("resource-AutoscalersResourceApi", () { |
706 unittest.test("method--delete", () { | 741 unittest.test("method--delete", () { |
707 | 742 |
708 var mock = new common_test.HttpServerMock(); | 743 var mock = new HttpServerMock(); |
709 api.AutoscalersResourceApi res = new api.AutoscalerApi(mock).autoscalers; | 744 api.AutoscalersResourceApi res = new api.AutoscalerApi(mock).autoscalers; |
710 var arg_project = "foo"; | 745 var arg_project = "foo"; |
711 var arg_zone = "foo"; | 746 var arg_zone = "foo"; |
712 var arg_autoscaler = "foo"; | 747 var arg_autoscaler = "foo"; |
713 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 748 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
714 var path = (req.url).path; | 749 var path = (req.url).path; |
715 var pathOffset = 0; | 750 var pathOffset = 0; |
716 var index; | 751 var index; |
717 var subPart; | 752 var subPart; |
718 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 753 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 var keyvalue = part.split("="); | 789 var keyvalue = part.split("="); |
755 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 790 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
756 } | 791 } |
757 } | 792 } |
758 | 793 |
759 | 794 |
760 var h = { | 795 var h = { |
761 "content-type" : "application/json; charset=utf-8", | 796 "content-type" : "application/json; charset=utf-8", |
762 }; | 797 }; |
763 var resp = convert.JSON.encode(buildOperation()); | 798 var resp = convert.JSON.encode(buildOperation()); |
764 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 799 return new async.Future.value(stringResponse(200, h, resp)); |
765 }), true); | 800 }), true); |
766 res.delete(arg_project, arg_zone, arg_autoscaler).then(unittest.expectAsyn
c(((api.Operation response) { | 801 res.delete(arg_project, arg_zone, arg_autoscaler).then(unittest.expectAsyn
c(((api.Operation response) { |
767 checkOperation(response); | 802 checkOperation(response); |
768 }))); | 803 }))); |
769 }); | 804 }); |
770 | 805 |
771 unittest.test("method--get", () { | 806 unittest.test("method--get", () { |
772 | 807 |
773 var mock = new common_test.HttpServerMock(); | 808 var mock = new HttpServerMock(); |
774 api.AutoscalersResourceApi res = new api.AutoscalerApi(mock).autoscalers; | 809 api.AutoscalersResourceApi res = new api.AutoscalerApi(mock).autoscalers; |
775 var arg_project = "foo"; | 810 var arg_project = "foo"; |
776 var arg_zone = "foo"; | 811 var arg_zone = "foo"; |
777 var arg_autoscaler = "foo"; | 812 var arg_autoscaler = "foo"; |
778 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 813 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
779 var path = (req.url).path; | 814 var path = (req.url).path; |
780 var pathOffset = 0; | 815 var pathOffset = 0; |
781 var index; | 816 var index; |
782 var subPart; | 817 var subPart; |
783 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 818 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 var keyvalue = part.split("="); | 854 var keyvalue = part.split("="); |
820 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 855 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
821 } | 856 } |
822 } | 857 } |
823 | 858 |
824 | 859 |
825 var h = { | 860 var h = { |
826 "content-type" : "application/json; charset=utf-8", | 861 "content-type" : "application/json; charset=utf-8", |
827 }; | 862 }; |
828 var resp = convert.JSON.encode(buildAutoscaler()); | 863 var resp = convert.JSON.encode(buildAutoscaler()); |
829 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 864 return new async.Future.value(stringResponse(200, h, resp)); |
830 }), true); | 865 }), true); |
831 res.get(arg_project, arg_zone, arg_autoscaler).then(unittest.expectAsync((
(api.Autoscaler response) { | 866 res.get(arg_project, arg_zone, arg_autoscaler).then(unittest.expectAsync((
(api.Autoscaler response) { |
832 checkAutoscaler(response); | 867 checkAutoscaler(response); |
833 }))); | 868 }))); |
834 }); | 869 }); |
835 | 870 |
836 unittest.test("method--insert", () { | 871 unittest.test("method--insert", () { |
837 | 872 |
838 var mock = new common_test.HttpServerMock(); | 873 var mock = new HttpServerMock(); |
839 api.AutoscalersResourceApi res = new api.AutoscalerApi(mock).autoscalers; | 874 api.AutoscalersResourceApi res = new api.AutoscalerApi(mock).autoscalers; |
840 var arg_request = buildAutoscaler(); | 875 var arg_request = buildAutoscaler(); |
841 var arg_project = "foo"; | 876 var arg_project = "foo"; |
842 var arg_zone = "foo"; | 877 var arg_zone = "foo"; |
843 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 878 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
844 var obj = new api.Autoscaler.fromJson(json); | 879 var obj = new api.Autoscaler.fromJson(json); |
845 checkAutoscaler(obj); | 880 checkAutoscaler(obj); |
846 | 881 |
847 var path = (req.url).path; | 882 var path = (req.url).path; |
848 var pathOffset = 0; | 883 var pathOffset = 0; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 var keyvalue = part.split("="); | 919 var keyvalue = part.split("="); |
885 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 920 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
886 } | 921 } |
887 } | 922 } |
888 | 923 |
889 | 924 |
890 var h = { | 925 var h = { |
891 "content-type" : "application/json; charset=utf-8", | 926 "content-type" : "application/json; charset=utf-8", |
892 }; | 927 }; |
893 var resp = convert.JSON.encode(buildOperation()); | 928 var resp = convert.JSON.encode(buildOperation()); |
894 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 929 return new async.Future.value(stringResponse(200, h, resp)); |
895 }), true); | 930 }), true); |
896 res.insert(arg_request, arg_project, arg_zone).then(unittest.expectAsync((
(api.Operation response) { | 931 res.insert(arg_request, arg_project, arg_zone).then(unittest.expectAsync((
(api.Operation response) { |
897 checkOperation(response); | 932 checkOperation(response); |
898 }))); | 933 }))); |
899 }); | 934 }); |
900 | 935 |
901 unittest.test("method--list", () { | 936 unittest.test("method--list", () { |
902 | 937 |
903 var mock = new common_test.HttpServerMock(); | 938 var mock = new HttpServerMock(); |
904 api.AutoscalersResourceApi res = new api.AutoscalerApi(mock).autoscalers; | 939 api.AutoscalersResourceApi res = new api.AutoscalerApi(mock).autoscalers; |
905 var arg_project = "foo"; | 940 var arg_project = "foo"; |
906 var arg_zone = "foo"; | 941 var arg_zone = "foo"; |
907 var arg_filter = "foo"; | 942 var arg_filter = "foo"; |
908 var arg_maxResults = 42; | 943 var arg_maxResults = 42; |
909 var arg_pageToken = "foo"; | 944 var arg_pageToken = "foo"; |
910 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 945 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
911 var path = (req.url).path; | 946 var path = (req.url).path; |
912 var pathOffset = 0; | 947 var pathOffset = 0; |
913 var index; | 948 var index; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 } | 986 } |
952 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 987 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
953 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 988 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
954 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 989 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
955 | 990 |
956 | 991 |
957 var h = { | 992 var h = { |
958 "content-type" : "application/json; charset=utf-8", | 993 "content-type" : "application/json; charset=utf-8", |
959 }; | 994 }; |
960 var resp = convert.JSON.encode(buildAutoscalerListResponse()); | 995 var resp = convert.JSON.encode(buildAutoscalerListResponse()); |
961 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 996 return new async.Future.value(stringResponse(200, h, resp)); |
962 }), true); | 997 }), true); |
963 res.list(arg_project, arg_zone, filter: arg_filter, maxResults: arg_maxRes
ults, pageToken: arg_pageToken).then(unittest.expectAsync(((api.AutoscalerListRe
sponse response) { | 998 res.list(arg_project, arg_zone, filter: arg_filter, maxResults: arg_maxRes
ults, pageToken: arg_pageToken).then(unittest.expectAsync(((api.AutoscalerListRe
sponse response) { |
964 checkAutoscalerListResponse(response); | 999 checkAutoscalerListResponse(response); |
965 }))); | 1000 }))); |
966 }); | 1001 }); |
967 | 1002 |
968 unittest.test("method--patch", () { | 1003 unittest.test("method--patch", () { |
969 | 1004 |
970 var mock = new common_test.HttpServerMock(); | 1005 var mock = new HttpServerMock(); |
971 api.AutoscalersResourceApi res = new api.AutoscalerApi(mock).autoscalers; | 1006 api.AutoscalersResourceApi res = new api.AutoscalerApi(mock).autoscalers; |
972 var arg_request = buildAutoscaler(); | 1007 var arg_request = buildAutoscaler(); |
973 var arg_project = "foo"; | 1008 var arg_project = "foo"; |
974 var arg_zone = "foo"; | 1009 var arg_zone = "foo"; |
975 var arg_autoscaler = "foo"; | 1010 var arg_autoscaler = "foo"; |
976 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1011 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
977 var obj = new api.Autoscaler.fromJson(json); | 1012 var obj = new api.Autoscaler.fromJson(json); |
978 checkAutoscaler(obj); | 1013 checkAutoscaler(obj); |
979 | 1014 |
980 var path = (req.url).path; | 1015 var path = (req.url).path; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 var keyvalue = part.split("="); | 1055 var keyvalue = part.split("="); |
1021 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1056 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1022 } | 1057 } |
1023 } | 1058 } |
1024 | 1059 |
1025 | 1060 |
1026 var h = { | 1061 var h = { |
1027 "content-type" : "application/json; charset=utf-8", | 1062 "content-type" : "application/json; charset=utf-8", |
1028 }; | 1063 }; |
1029 var resp = convert.JSON.encode(buildOperation()); | 1064 var resp = convert.JSON.encode(buildOperation()); |
1030 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1065 return new async.Future.value(stringResponse(200, h, resp)); |
1031 }), true); | 1066 }), true); |
1032 res.patch(arg_request, arg_project, arg_zone, arg_autoscaler).then(unittes
t.expectAsync(((api.Operation response) { | 1067 res.patch(arg_request, arg_project, arg_zone, arg_autoscaler).then(unittes
t.expectAsync(((api.Operation response) { |
1033 checkOperation(response); | 1068 checkOperation(response); |
1034 }))); | 1069 }))); |
1035 }); | 1070 }); |
1036 | 1071 |
1037 unittest.test("method--update", () { | 1072 unittest.test("method--update", () { |
1038 | 1073 |
1039 var mock = new common_test.HttpServerMock(); | 1074 var mock = new HttpServerMock(); |
1040 api.AutoscalersResourceApi res = new api.AutoscalerApi(mock).autoscalers; | 1075 api.AutoscalersResourceApi res = new api.AutoscalerApi(mock).autoscalers; |
1041 var arg_request = buildAutoscaler(); | 1076 var arg_request = buildAutoscaler(); |
1042 var arg_project = "foo"; | 1077 var arg_project = "foo"; |
1043 var arg_zone = "foo"; | 1078 var arg_zone = "foo"; |
1044 var arg_autoscaler = "foo"; | 1079 var arg_autoscaler = "foo"; |
1045 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1080 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1046 var obj = new api.Autoscaler.fromJson(json); | 1081 var obj = new api.Autoscaler.fromJson(json); |
1047 checkAutoscaler(obj); | 1082 checkAutoscaler(obj); |
1048 | 1083 |
1049 var path = (req.url).path; | 1084 var path = (req.url).path; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 var keyvalue = part.split("="); | 1124 var keyvalue = part.split("="); |
1090 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1125 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1091 } | 1126 } |
1092 } | 1127 } |
1093 | 1128 |
1094 | 1129 |
1095 var h = { | 1130 var h = { |
1096 "content-type" : "application/json; charset=utf-8", | 1131 "content-type" : "application/json; charset=utf-8", |
1097 }; | 1132 }; |
1098 var resp = convert.JSON.encode(buildOperation()); | 1133 var resp = convert.JSON.encode(buildOperation()); |
1099 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1134 return new async.Future.value(stringResponse(200, h, resp)); |
1100 }), true); | 1135 }), true); |
1101 res.update(arg_request, arg_project, arg_zone, arg_autoscaler).then(unitte
st.expectAsync(((api.Operation response) { | 1136 res.update(arg_request, arg_project, arg_zone, arg_autoscaler).then(unitte
st.expectAsync(((api.Operation response) { |
1102 checkOperation(response); | 1137 checkOperation(response); |
1103 }))); | 1138 }))); |
1104 }); | 1139 }); |
1105 | 1140 |
1106 }); | 1141 }); |
1107 | 1142 |
1108 | 1143 |
1109 unittest.group("resource-ZoneOperationsResourceApi", () { | 1144 unittest.group("resource-ZoneOperationsResourceApi", () { |
1110 unittest.test("method--delete", () { | 1145 unittest.test("method--delete", () { |
1111 | 1146 |
1112 var mock = new common_test.HttpServerMock(); | 1147 var mock = new HttpServerMock(); |
1113 api.ZoneOperationsResourceApi res = new api.AutoscalerApi(mock).zoneOperat
ions; | 1148 api.ZoneOperationsResourceApi res = new api.AutoscalerApi(mock).zoneOperat
ions; |
1114 var arg_project = "foo"; | 1149 var arg_project = "foo"; |
1115 var arg_zone = "foo"; | 1150 var arg_zone = "foo"; |
1116 var arg_operation = "foo"; | 1151 var arg_operation = "foo"; |
1117 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1152 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1118 var path = (req.url).path; | 1153 var path = (req.url).path; |
1119 var pathOffset = 0; | 1154 var pathOffset = 0; |
1120 var index; | 1155 var index; |
1121 var subPart; | 1156 var subPart; |
1122 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1157 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 14 matching lines...) Expand all Loading... |
1137 var keyvalue = part.split("="); | 1172 var keyvalue = part.split("="); |
1138 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1173 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1139 } | 1174 } |
1140 } | 1175 } |
1141 | 1176 |
1142 | 1177 |
1143 var h = { | 1178 var h = { |
1144 "content-type" : "application/json; charset=utf-8", | 1179 "content-type" : "application/json; charset=utf-8", |
1145 }; | 1180 }; |
1146 var resp = ""; | 1181 var resp = ""; |
1147 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1182 return new async.Future.value(stringResponse(200, h, resp)); |
1148 }), true); | 1183 }), true); |
1149 res.delete(arg_project, arg_zone, arg_operation).then(unittest.expectAsync
((_) {})); | 1184 res.delete(arg_project, arg_zone, arg_operation).then(unittest.expectAsync
((_) {})); |
1150 }); | 1185 }); |
1151 | 1186 |
1152 unittest.test("method--get", () { | 1187 unittest.test("method--get", () { |
1153 | 1188 |
1154 var mock = new common_test.HttpServerMock(); | 1189 var mock = new HttpServerMock(); |
1155 api.ZoneOperationsResourceApi res = new api.AutoscalerApi(mock).zoneOperat
ions; | 1190 api.ZoneOperationsResourceApi res = new api.AutoscalerApi(mock).zoneOperat
ions; |
1156 var arg_project = "foo"; | 1191 var arg_project = "foo"; |
1157 var arg_zone = "foo"; | 1192 var arg_zone = "foo"; |
1158 var arg_operation = "foo"; | 1193 var arg_operation = "foo"; |
1159 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1194 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1160 var path = (req.url).path; | 1195 var path = (req.url).path; |
1161 var pathOffset = 0; | 1196 var pathOffset = 0; |
1162 var index; | 1197 var index; |
1163 var subPart; | 1198 var subPart; |
1164 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1199 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
(...skipping 14 matching lines...) Expand all Loading... |
1179 var keyvalue = part.split("="); | 1214 var keyvalue = part.split("="); |
1180 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1215 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1181 } | 1216 } |
1182 } | 1217 } |
1183 | 1218 |
1184 | 1219 |
1185 var h = { | 1220 var h = { |
1186 "content-type" : "application/json; charset=utf-8", | 1221 "content-type" : "application/json; charset=utf-8", |
1187 }; | 1222 }; |
1188 var resp = convert.JSON.encode(buildOperation()); | 1223 var resp = convert.JSON.encode(buildOperation()); |
1189 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1224 return new async.Future.value(stringResponse(200, h, resp)); |
1190 }), true); | 1225 }), true); |
1191 res.get(arg_project, arg_zone, arg_operation).then(unittest.expectAsync(((
api.Operation response) { | 1226 res.get(arg_project, arg_zone, arg_operation).then(unittest.expectAsync(((
api.Operation response) { |
1192 checkOperation(response); | 1227 checkOperation(response); |
1193 }))); | 1228 }))); |
1194 }); | 1229 }); |
1195 | 1230 |
1196 unittest.test("method--list", () { | 1231 unittest.test("method--list", () { |
1197 | 1232 |
1198 var mock = new common_test.HttpServerMock(); | 1233 var mock = new HttpServerMock(); |
1199 api.ZoneOperationsResourceApi res = new api.AutoscalerApi(mock).zoneOperat
ions; | 1234 api.ZoneOperationsResourceApi res = new api.AutoscalerApi(mock).zoneOperat
ions; |
1200 var arg_project = "foo"; | 1235 var arg_project = "foo"; |
1201 var arg_zone = "foo"; | 1236 var arg_zone = "foo"; |
1202 var arg_filter = "foo"; | 1237 var arg_filter = "foo"; |
1203 var arg_maxResults = 42; | 1238 var arg_maxResults = 42; |
1204 var arg_pageToken = "foo"; | 1239 var arg_pageToken = "foo"; |
1205 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1240 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1206 var path = (req.url).path; | 1241 var path = (req.url).path; |
1207 var pathOffset = 0; | 1242 var pathOffset = 0; |
1208 var index; | 1243 var index; |
(...skipping 19 matching lines...) Expand all Loading... |
1228 } | 1263 } |
1229 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1264 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
1230 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1265 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
1231 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1266 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1232 | 1267 |
1233 | 1268 |
1234 var h = { | 1269 var h = { |
1235 "content-type" : "application/json; charset=utf-8", | 1270 "content-type" : "application/json; charset=utf-8", |
1236 }; | 1271 }; |
1237 var resp = convert.JSON.encode(buildOperationList()); | 1272 var resp = convert.JSON.encode(buildOperationList()); |
1238 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1273 return new async.Future.value(stringResponse(200, h, resp)); |
1239 }), true); | 1274 }), true); |
1240 res.list(arg_project, arg_zone, filter: arg_filter, maxResults: arg_maxRes
ults, pageToken: arg_pageToken).then(unittest.expectAsync(((api.OperationList re
sponse) { | 1275 res.list(arg_project, arg_zone, filter: arg_filter, maxResults: arg_maxRes
ults, pageToken: arg_pageToken).then(unittest.expectAsync(((api.OperationList re
sponse) { |
1241 checkOperationList(response); | 1276 checkOperationList(response); |
1242 }))); | 1277 }))); |
1243 }); | 1278 }); |
1244 | 1279 |
1245 }); | 1280 }); |
1246 | 1281 |
1247 | 1282 |
1248 unittest.group("resource-ZonesResourceApi", () { | 1283 unittest.group("resource-ZonesResourceApi", () { |
1249 unittest.test("method--list", () { | 1284 unittest.test("method--list", () { |
1250 | 1285 |
1251 var mock = new common_test.HttpServerMock(); | 1286 var mock = new HttpServerMock(); |
1252 api.ZonesResourceApi res = new api.AutoscalerApi(mock).zones; | 1287 api.ZonesResourceApi res = new api.AutoscalerApi(mock).zones; |
1253 var arg_project = "foo"; | 1288 var arg_project = "foo"; |
1254 var arg_filter = "foo"; | 1289 var arg_filter = "foo"; |
1255 var arg_maxResults = 42; | 1290 var arg_maxResults = 42; |
1256 var arg_pageToken = "foo"; | 1291 var arg_pageToken = "foo"; |
1257 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1292 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1258 var path = (req.url).path; | 1293 var path = (req.url).path; |
1259 var pathOffset = 0; | 1294 var pathOffset = 0; |
1260 var index; | 1295 var index; |
1261 var subPart; | 1296 var subPart; |
(...skipping 18 matching lines...) Expand all Loading... |
1280 } | 1315 } |
1281 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1316 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
1282 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1317 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
1283 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1318 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1284 | 1319 |
1285 | 1320 |
1286 var h = { | 1321 var h = { |
1287 "content-type" : "application/json; charset=utf-8", | 1322 "content-type" : "application/json; charset=utf-8", |
1288 }; | 1323 }; |
1289 var resp = convert.JSON.encode(buildZoneList()); | 1324 var resp = convert.JSON.encode(buildZoneList()); |
1290 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1325 return new async.Future.value(stringResponse(200, h, resp)); |
1291 }), true); | 1326 }), true); |
1292 res.list(arg_project, filter: arg_filter, maxResults: arg_maxResults, page
Token: arg_pageToken).then(unittest.expectAsync(((api.ZoneList response) { | 1327 res.list(arg_project, filter: arg_filter, maxResults: arg_maxResults, page
Token: arg_pageToken).then(unittest.expectAsync(((api.ZoneList response) { |
1293 checkZoneList(response); | 1328 checkZoneList(response); |
1294 }))); | 1329 }))); |
1295 }); | 1330 }); |
1296 | 1331 |
1297 }); | 1332 }); |
1298 | 1333 |
1299 | 1334 |
1300 } | 1335 } |
1301 | 1336 |
OLD | NEW |