Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: generated/googleapis_beta/test/replicapool/v1beta1_test.dart

Issue 698403003: Api roll 5: 2014-11-05 (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 library googleapis_beta.replicapool.v1beta1.test;
2
3 import "dart:core" as core;
4 import "dart:collection" as collection;
5 import "dart:async" as async;
6 import "dart:convert" as convert;
7
8 import 'package:http/http.dart' as http;
9 import 'package:http/testing.dart' as http_testing;
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
15 import 'package:googleapis_beta/replicapool/v1beta1.dart' as api;
16
17
18
19 core.int buildCounterAccessConfig = 0;
20 buildAccessConfig() {
21 var o = new api.AccessConfig();
22 buildCounterAccessConfig++;
23 if (buildCounterAccessConfig < 3) {
24 o.name = "foo";
25 o.natIp = "foo";
26 o.type = "foo";
27 }
28 buildCounterAccessConfig--;
29 return o;
30 }
31
32 checkAccessConfig(api.AccessConfig o) {
33 buildCounterAccessConfig++;
34 if (buildCounterAccessConfig < 3) {
35 unittest.expect(o.name, unittest.equals('foo'));
36 unittest.expect(o.natIp, unittest.equals('foo'));
37 unittest.expect(o.type, unittest.equals('foo'));
38 }
39 buildCounterAccessConfig--;
40 }
41
42 buildUnnamed1150() {
43 var o = new core.List<core.String>();
44 o.add("foo");
45 o.add("foo");
46 return o;
47 }
48
49 checkUnnamed1150(core.List<core.String> o) {
50 unittest.expect(o, unittest.hasLength(2));
51 unittest.expect(o[0], unittest.equals('foo'));
52 unittest.expect(o[1], unittest.equals('foo'));
53 }
54
55 buildUnnamed1151() {
56 var o = new core.List<api.EnvVariable>();
57 o.add(buildEnvVariable());
58 o.add(buildEnvVariable());
59 return o;
60 }
61
62 checkUnnamed1151(core.List<api.EnvVariable> o) {
63 unittest.expect(o, unittest.hasLength(2));
64 checkEnvVariable(o[0]);
65 checkEnvVariable(o[1]);
66 }
67
68 core.int buildCounterAction = 0;
69 buildAction() {
70 var o = new api.Action();
71 buildCounterAction++;
72 if (buildCounterAction < 3) {
73 o.commands = buildUnnamed1150();
74 o.envVariables = buildUnnamed1151();
75 o.timeoutMilliSeconds = 42;
76 }
77 buildCounterAction--;
78 return o;
79 }
80
81 checkAction(api.Action o) {
82 buildCounterAction++;
83 if (buildCounterAction < 3) {
84 checkUnnamed1150(o.commands);
85 checkUnnamed1151(o.envVariables);
86 unittest.expect(o.timeoutMilliSeconds, unittest.equals(42));
87 }
88 buildCounterAction--;
89 }
90
91 core.int buildCounterDiskAttachment = 0;
92 buildDiskAttachment() {
93 var o = new api.DiskAttachment();
94 buildCounterDiskAttachment++;
95 if (buildCounterDiskAttachment < 3) {
96 o.deviceName = "foo";
97 o.index = 42;
98 }
99 buildCounterDiskAttachment--;
100 return o;
101 }
102
103 checkDiskAttachment(api.DiskAttachment o) {
104 buildCounterDiskAttachment++;
105 if (buildCounterDiskAttachment < 3) {
106 unittest.expect(o.deviceName, unittest.equals('foo'));
107 unittest.expect(o.index, unittest.equals(42));
108 }
109 buildCounterDiskAttachment--;
110 }
111
112 core.int buildCounterEnvVariable = 0;
113 buildEnvVariable() {
114 var o = new api.EnvVariable();
115 buildCounterEnvVariable++;
116 if (buildCounterEnvVariable < 3) {
117 o.hidden = true;
118 o.name = "foo";
119 o.value = "foo";
120 }
121 buildCounterEnvVariable--;
122 return o;
123 }
124
125 checkEnvVariable(api.EnvVariable o) {
126 buildCounterEnvVariable++;
127 if (buildCounterEnvVariable < 3) {
128 unittest.expect(o.hidden, unittest.isTrue);
129 unittest.expect(o.name, unittest.equals('foo'));
130 unittest.expect(o.value, unittest.equals('foo'));
131 }
132 buildCounterEnvVariable--;
133 }
134
135 core.int buildCounterExistingDisk = 0;
136 buildExistingDisk() {
137 var o = new api.ExistingDisk();
138 buildCounterExistingDisk++;
139 if (buildCounterExistingDisk < 3) {
140 o.attachment = buildDiskAttachment();
141 o.source = "foo";
142 }
143 buildCounterExistingDisk--;
144 return o;
145 }
146
147 checkExistingDisk(api.ExistingDisk o) {
148 buildCounterExistingDisk++;
149 if (buildCounterExistingDisk < 3) {
150 checkDiskAttachment(o.attachment);
151 unittest.expect(o.source, unittest.equals('foo'));
152 }
153 buildCounterExistingDisk--;
154 }
155
156 core.int buildCounterHealthCheck = 0;
157 buildHealthCheck() {
158 var o = new api.HealthCheck();
159 buildCounterHealthCheck++;
160 if (buildCounterHealthCheck < 3) {
161 o.checkIntervalSec = 42;
162 o.description = "foo";
163 o.healthyThreshold = 42;
164 o.host = "foo";
165 o.name = "foo";
166 o.path = "foo";
167 o.port = 42;
168 o.timeoutSec = 42;
169 o.unhealthyThreshold = 42;
170 }
171 buildCounterHealthCheck--;
172 return o;
173 }
174
175 checkHealthCheck(api.HealthCheck o) {
176 buildCounterHealthCheck++;
177 if (buildCounterHealthCheck < 3) {
178 unittest.expect(o.checkIntervalSec, unittest.equals(42));
179 unittest.expect(o.description, unittest.equals('foo'));
180 unittest.expect(o.healthyThreshold, unittest.equals(42));
181 unittest.expect(o.host, unittest.equals('foo'));
182 unittest.expect(o.name, unittest.equals('foo'));
183 unittest.expect(o.path, unittest.equals('foo'));
184 unittest.expect(o.port, unittest.equals(42));
185 unittest.expect(o.timeoutSec, unittest.equals(42));
186 unittest.expect(o.unhealthyThreshold, unittest.equals(42));
187 }
188 buildCounterHealthCheck--;
189 }
190
191 core.int buildCounterLabel = 0;
192 buildLabel() {
193 var o = new api.Label();
194 buildCounterLabel++;
195 if (buildCounterLabel < 3) {
196 o.key = "foo";
197 o.value = "foo";
198 }
199 buildCounterLabel--;
200 return o;
201 }
202
203 checkLabel(api.Label o) {
204 buildCounterLabel++;
205 if (buildCounterLabel < 3) {
206 unittest.expect(o.key, unittest.equals('foo'));
207 unittest.expect(o.value, unittest.equals('foo'));
208 }
209 buildCounterLabel--;
210 }
211
212 buildUnnamed1152() {
213 var o = new core.List<api.MetadataItem>();
214 o.add(buildMetadataItem());
215 o.add(buildMetadataItem());
216 return o;
217 }
218
219 checkUnnamed1152(core.List<api.MetadataItem> o) {
220 unittest.expect(o, unittest.hasLength(2));
221 checkMetadataItem(o[0]);
222 checkMetadataItem(o[1]);
223 }
224
225 core.int buildCounterMetadata = 0;
226 buildMetadata() {
227 var o = new api.Metadata();
228 buildCounterMetadata++;
229 if (buildCounterMetadata < 3) {
230 o.fingerPrint = "foo";
231 o.items = buildUnnamed1152();
232 }
233 buildCounterMetadata--;
234 return o;
235 }
236
237 checkMetadata(api.Metadata o) {
238 buildCounterMetadata++;
239 if (buildCounterMetadata < 3) {
240 unittest.expect(o.fingerPrint, unittest.equals('foo'));
241 checkUnnamed1152(o.items);
242 }
243 buildCounterMetadata--;
244 }
245
246 core.int buildCounterMetadataItem = 0;
247 buildMetadataItem() {
248 var o = new api.MetadataItem();
249 buildCounterMetadataItem++;
250 if (buildCounterMetadataItem < 3) {
251 o.key = "foo";
252 o.value = "foo";
253 }
254 buildCounterMetadataItem--;
255 return o;
256 }
257
258 checkMetadataItem(api.MetadataItem o) {
259 buildCounterMetadataItem++;
260 if (buildCounterMetadataItem < 3) {
261 unittest.expect(o.key, unittest.equals('foo'));
262 unittest.expect(o.value, unittest.equals('foo'));
263 }
264 buildCounterMetadataItem--;
265 }
266
267 buildUnnamed1153() {
268 var o = new core.List<api.AccessConfig>();
269 o.add(buildAccessConfig());
270 o.add(buildAccessConfig());
271 return o;
272 }
273
274 checkUnnamed1153(core.List<api.AccessConfig> o) {
275 unittest.expect(o, unittest.hasLength(2));
276 checkAccessConfig(o[0]);
277 checkAccessConfig(o[1]);
278 }
279
280 core.int buildCounterNetworkInterface = 0;
281 buildNetworkInterface() {
282 var o = new api.NetworkInterface();
283 buildCounterNetworkInterface++;
284 if (buildCounterNetworkInterface < 3) {
285 o.accessConfigs = buildUnnamed1153();
286 o.network = "foo";
287 o.networkIp = "foo";
288 }
289 buildCounterNetworkInterface--;
290 return o;
291 }
292
293 checkNetworkInterface(api.NetworkInterface o) {
294 buildCounterNetworkInterface++;
295 if (buildCounterNetworkInterface < 3) {
296 checkUnnamed1153(o.accessConfigs);
297 unittest.expect(o.network, unittest.equals('foo'));
298 unittest.expect(o.networkIp, unittest.equals('foo'));
299 }
300 buildCounterNetworkInterface--;
301 }
302
303 core.int buildCounterNewDisk = 0;
304 buildNewDisk() {
305 var o = new api.NewDisk();
306 buildCounterNewDisk++;
307 if (buildCounterNewDisk < 3) {
308 o.attachment = buildDiskAttachment();
309 o.autoDelete = true;
310 o.boot = true;
311 o.initializeParams = buildNewDiskInitializeParams();
312 }
313 buildCounterNewDisk--;
314 return o;
315 }
316
317 checkNewDisk(api.NewDisk o) {
318 buildCounterNewDisk++;
319 if (buildCounterNewDisk < 3) {
320 checkDiskAttachment(o.attachment);
321 unittest.expect(o.autoDelete, unittest.isTrue);
322 unittest.expect(o.boot, unittest.isTrue);
323 checkNewDiskInitializeParams(o.initializeParams);
324 }
325 buildCounterNewDisk--;
326 }
327
328 core.int buildCounterNewDiskInitializeParams = 0;
329 buildNewDiskInitializeParams() {
330 var o = new api.NewDiskInitializeParams();
331 buildCounterNewDiskInitializeParams++;
332 if (buildCounterNewDiskInitializeParams < 3) {
333 o.diskSizeGb = "foo";
334 o.diskType = "foo";
335 o.sourceImage = "foo";
336 }
337 buildCounterNewDiskInitializeParams--;
338 return o;
339 }
340
341 checkNewDiskInitializeParams(api.NewDiskInitializeParams o) {
342 buildCounterNewDiskInitializeParams++;
343 if (buildCounterNewDiskInitializeParams < 3) {
344 unittest.expect(o.diskSizeGb, unittest.equals('foo'));
345 unittest.expect(o.diskType, unittest.equals('foo'));
346 unittest.expect(o.sourceImage, unittest.equals('foo'));
347 }
348 buildCounterNewDiskInitializeParams--;
349 }
350
351 buildUnnamed1154() {
352 var o = new core.List<api.HealthCheck>();
353 o.add(buildHealthCheck());
354 o.add(buildHealthCheck());
355 return o;
356 }
357
358 checkUnnamed1154(core.List<api.HealthCheck> o) {
359 unittest.expect(o, unittest.hasLength(2));
360 checkHealthCheck(o[0]);
361 checkHealthCheck(o[1]);
362 }
363
364 buildUnnamed1155() {
365 var o = new core.List<api.Label>();
366 o.add(buildLabel());
367 o.add(buildLabel());
368 return o;
369 }
370
371 checkUnnamed1155(core.List<api.Label> o) {
372 unittest.expect(o, unittest.hasLength(2));
373 checkLabel(o[0]);
374 checkLabel(o[1]);
375 }
376
377 buildUnnamed1156() {
378 var o = new core.List<core.String>();
379 o.add("foo");
380 o.add("foo");
381 return o;
382 }
383
384 checkUnnamed1156(core.List<core.String> o) {
385 unittest.expect(o, unittest.hasLength(2));
386 unittest.expect(o[0], unittest.equals('foo'));
387 unittest.expect(o[1], unittest.equals('foo'));
388 }
389
390 buildUnnamed1157() {
391 var o = new core.List<core.String>();
392 o.add("foo");
393 o.add("foo");
394 return o;
395 }
396
397 checkUnnamed1157(core.List<core.String> o) {
398 unittest.expect(o, unittest.hasLength(2));
399 unittest.expect(o[0], unittest.equals('foo'));
400 unittest.expect(o[1], unittest.equals('foo'));
401 }
402
403 core.int buildCounterPool = 0;
404 buildPool() {
405 var o = new api.Pool();
406 buildCounterPool++;
407 if (buildCounterPool < 3) {
408 o.autoRestart = true;
409 o.baseInstanceName = "foo";
410 o.currentNumReplicas = 42;
411 o.description = "foo";
412 o.healthChecks = buildUnnamed1154();
413 o.initialNumReplicas = 42;
414 o.labels = buildUnnamed1155();
415 o.name = "foo";
416 o.numReplicas = 42;
417 o.resourceViews = buildUnnamed1156();
418 o.selfLink = "foo";
419 o.targetPool = "foo";
420 o.targetPools = buildUnnamed1157();
421 o.template = buildTemplate();
422 o.type = "foo";
423 }
424 buildCounterPool--;
425 return o;
426 }
427
428 checkPool(api.Pool o) {
429 buildCounterPool++;
430 if (buildCounterPool < 3) {
431 unittest.expect(o.autoRestart, unittest.isTrue);
432 unittest.expect(o.baseInstanceName, unittest.equals('foo'));
433 unittest.expect(o.currentNumReplicas, unittest.equals(42));
434 unittest.expect(o.description, unittest.equals('foo'));
435 checkUnnamed1154(o.healthChecks);
436 unittest.expect(o.initialNumReplicas, unittest.equals(42));
437 checkUnnamed1155(o.labels);
438 unittest.expect(o.name, unittest.equals('foo'));
439 unittest.expect(o.numReplicas, unittest.equals(42));
440 checkUnnamed1156(o.resourceViews);
441 unittest.expect(o.selfLink, unittest.equals('foo'));
442 unittest.expect(o.targetPool, unittest.equals('foo'));
443 checkUnnamed1157(o.targetPools);
444 checkTemplate(o.template);
445 unittest.expect(o.type, unittest.equals('foo'));
446 }
447 buildCounterPool--;
448 }
449
450 buildUnnamed1158() {
451 var o = new core.List<core.String>();
452 o.add("foo");
453 o.add("foo");
454 return o;
455 }
456
457 checkUnnamed1158(core.List<core.String> o) {
458 unittest.expect(o, unittest.hasLength(2));
459 unittest.expect(o[0], unittest.equals('foo'));
460 unittest.expect(o[1], unittest.equals('foo'));
461 }
462
463 core.int buildCounterPoolsDeleteRequest = 0;
464 buildPoolsDeleteRequest() {
465 var o = new api.PoolsDeleteRequest();
466 buildCounterPoolsDeleteRequest++;
467 if (buildCounterPoolsDeleteRequest < 3) {
468 o.abandonInstances = buildUnnamed1158();
469 }
470 buildCounterPoolsDeleteRequest--;
471 return o;
472 }
473
474 checkPoolsDeleteRequest(api.PoolsDeleteRequest o) {
475 buildCounterPoolsDeleteRequest++;
476 if (buildCounterPoolsDeleteRequest < 3) {
477 checkUnnamed1158(o.abandonInstances);
478 }
479 buildCounterPoolsDeleteRequest--;
480 }
481
482 buildUnnamed1159() {
483 var o = new core.List<api.Pool>();
484 o.add(buildPool());
485 o.add(buildPool());
486 return o;
487 }
488
489 checkUnnamed1159(core.List<api.Pool> o) {
490 unittest.expect(o, unittest.hasLength(2));
491 checkPool(o[0]);
492 checkPool(o[1]);
493 }
494
495 core.int buildCounterPoolsListResponse = 0;
496 buildPoolsListResponse() {
497 var o = new api.PoolsListResponse();
498 buildCounterPoolsListResponse++;
499 if (buildCounterPoolsListResponse < 3) {
500 o.nextPageToken = "foo";
501 o.resources = buildUnnamed1159();
502 }
503 buildCounterPoolsListResponse--;
504 return o;
505 }
506
507 checkPoolsListResponse(api.PoolsListResponse o) {
508 buildCounterPoolsListResponse++;
509 if (buildCounterPoolsListResponse < 3) {
510 unittest.expect(o.nextPageToken, unittest.equals('foo'));
511 checkUnnamed1159(o.resources);
512 }
513 buildCounterPoolsListResponse--;
514 }
515
516 core.int buildCounterReplica = 0;
517 buildReplica() {
518 var o = new api.Replica();
519 buildCounterReplica++;
520 if (buildCounterReplica < 3) {
521 o.name = "foo";
522 o.selfLink = "foo";
523 o.status = buildReplicaStatus();
524 }
525 buildCounterReplica--;
526 return o;
527 }
528
529 checkReplica(api.Replica o) {
530 buildCounterReplica++;
531 if (buildCounterReplica < 3) {
532 unittest.expect(o.name, unittest.equals('foo'));
533 unittest.expect(o.selfLink, unittest.equals('foo'));
534 checkReplicaStatus(o.status);
535 }
536 buildCounterReplica--;
537 }
538
539 core.int buildCounterReplicaStatus = 0;
540 buildReplicaStatus() {
541 var o = new api.ReplicaStatus();
542 buildCounterReplicaStatus++;
543 if (buildCounterReplicaStatus < 3) {
544 o.details = "foo";
545 o.state = "foo";
546 o.templateVersion = "foo";
547 o.vmLink = "foo";
548 o.vmStartTime = "foo";
549 }
550 buildCounterReplicaStatus--;
551 return o;
552 }
553
554 checkReplicaStatus(api.ReplicaStatus o) {
555 buildCounterReplicaStatus++;
556 if (buildCounterReplicaStatus < 3) {
557 unittest.expect(o.details, unittest.equals('foo'));
558 unittest.expect(o.state, unittest.equals('foo'));
559 unittest.expect(o.templateVersion, unittest.equals('foo'));
560 unittest.expect(o.vmLink, unittest.equals('foo'));
561 unittest.expect(o.vmStartTime, unittest.equals('foo'));
562 }
563 buildCounterReplicaStatus--;
564 }
565
566 core.int buildCounterReplicasDeleteRequest = 0;
567 buildReplicasDeleteRequest() {
568 var o = new api.ReplicasDeleteRequest();
569 buildCounterReplicasDeleteRequest++;
570 if (buildCounterReplicasDeleteRequest < 3) {
571 o.abandonInstance = true;
572 }
573 buildCounterReplicasDeleteRequest--;
574 return o;
575 }
576
577 checkReplicasDeleteRequest(api.ReplicasDeleteRequest o) {
578 buildCounterReplicasDeleteRequest++;
579 if (buildCounterReplicasDeleteRequest < 3) {
580 unittest.expect(o.abandonInstance, unittest.isTrue);
581 }
582 buildCounterReplicasDeleteRequest--;
583 }
584
585 buildUnnamed1160() {
586 var o = new core.List<api.Replica>();
587 o.add(buildReplica());
588 o.add(buildReplica());
589 return o;
590 }
591
592 checkUnnamed1160(core.List<api.Replica> o) {
593 unittest.expect(o, unittest.hasLength(2));
594 checkReplica(o[0]);
595 checkReplica(o[1]);
596 }
597
598 core.int buildCounterReplicasListResponse = 0;
599 buildReplicasListResponse() {
600 var o = new api.ReplicasListResponse();
601 buildCounterReplicasListResponse++;
602 if (buildCounterReplicasListResponse < 3) {
603 o.nextPageToken = "foo";
604 o.resources = buildUnnamed1160();
605 }
606 buildCounterReplicasListResponse--;
607 return o;
608 }
609
610 checkReplicasListResponse(api.ReplicasListResponse o) {
611 buildCounterReplicasListResponse++;
612 if (buildCounterReplicasListResponse < 3) {
613 unittest.expect(o.nextPageToken, unittest.equals('foo'));
614 checkUnnamed1160(o.resources);
615 }
616 buildCounterReplicasListResponse--;
617 }
618
619 buildUnnamed1161() {
620 var o = new core.List<core.String>();
621 o.add("foo");
622 o.add("foo");
623 return o;
624 }
625
626 checkUnnamed1161(core.List<core.String> o) {
627 unittest.expect(o, unittest.hasLength(2));
628 unittest.expect(o[0], unittest.equals('foo'));
629 unittest.expect(o[1], unittest.equals('foo'));
630 }
631
632 core.int buildCounterServiceAccount = 0;
633 buildServiceAccount() {
634 var o = new api.ServiceAccount();
635 buildCounterServiceAccount++;
636 if (buildCounterServiceAccount < 3) {
637 o.email = "foo";
638 o.scopes = buildUnnamed1161();
639 }
640 buildCounterServiceAccount--;
641 return o;
642 }
643
644 checkServiceAccount(api.ServiceAccount o) {
645 buildCounterServiceAccount++;
646 if (buildCounterServiceAccount < 3) {
647 unittest.expect(o.email, unittest.equals('foo'));
648 checkUnnamed1161(o.scopes);
649 }
650 buildCounterServiceAccount--;
651 }
652
653 buildUnnamed1162() {
654 var o = new core.List<core.String>();
655 o.add("foo");
656 o.add("foo");
657 return o;
658 }
659
660 checkUnnamed1162(core.List<core.String> o) {
661 unittest.expect(o, unittest.hasLength(2));
662 unittest.expect(o[0], unittest.equals('foo'));
663 unittest.expect(o[1], unittest.equals('foo'));
664 }
665
666 core.int buildCounterTag = 0;
667 buildTag() {
668 var o = new api.Tag();
669 buildCounterTag++;
670 if (buildCounterTag < 3) {
671 o.fingerPrint = "foo";
672 o.items = buildUnnamed1162();
673 }
674 buildCounterTag--;
675 return o;
676 }
677
678 checkTag(api.Tag o) {
679 buildCounterTag++;
680 if (buildCounterTag < 3) {
681 unittest.expect(o.fingerPrint, unittest.equals('foo'));
682 checkUnnamed1162(o.items);
683 }
684 buildCounterTag--;
685 }
686
687 buildUnnamed1163() {
688 var o = new core.List<api.HealthCheck>();
689 o.add(buildHealthCheck());
690 o.add(buildHealthCheck());
691 return o;
692 }
693
694 checkUnnamed1163(core.List<api.HealthCheck> o) {
695 unittest.expect(o, unittest.hasLength(2));
696 checkHealthCheck(o[0]);
697 checkHealthCheck(o[1]);
698 }
699
700 core.int buildCounterTemplate = 0;
701 buildTemplate() {
702 var o = new api.Template();
703 buildCounterTemplate++;
704 if (buildCounterTemplate < 3) {
705 o.action = buildAction();
706 o.healthChecks = buildUnnamed1163();
707 o.version = "foo";
708 o.vmParams = buildVmParams();
709 }
710 buildCounterTemplate--;
711 return o;
712 }
713
714 checkTemplate(api.Template o) {
715 buildCounterTemplate++;
716 if (buildCounterTemplate < 3) {
717 checkAction(o.action);
718 checkUnnamed1163(o.healthChecks);
719 unittest.expect(o.version, unittest.equals('foo'));
720 checkVmParams(o.vmParams);
721 }
722 buildCounterTemplate--;
723 }
724
725 buildUnnamed1164() {
726 var o = new core.List<api.ExistingDisk>();
727 o.add(buildExistingDisk());
728 o.add(buildExistingDisk());
729 return o;
730 }
731
732 checkUnnamed1164(core.List<api.ExistingDisk> o) {
733 unittest.expect(o, unittest.hasLength(2));
734 checkExistingDisk(o[0]);
735 checkExistingDisk(o[1]);
736 }
737
738 buildUnnamed1165() {
739 var o = new core.List<api.NewDisk>();
740 o.add(buildNewDisk());
741 o.add(buildNewDisk());
742 return o;
743 }
744
745 checkUnnamed1165(core.List<api.NewDisk> o) {
746 unittest.expect(o, unittest.hasLength(2));
747 checkNewDisk(o[0]);
748 checkNewDisk(o[1]);
749 }
750
751 buildUnnamed1166() {
752 var o = new core.List<api.NetworkInterface>();
753 o.add(buildNetworkInterface());
754 o.add(buildNetworkInterface());
755 return o;
756 }
757
758 checkUnnamed1166(core.List<api.NetworkInterface> o) {
759 unittest.expect(o, unittest.hasLength(2));
760 checkNetworkInterface(o[0]);
761 checkNetworkInterface(o[1]);
762 }
763
764 buildUnnamed1167() {
765 var o = new core.List<api.ServiceAccount>();
766 o.add(buildServiceAccount());
767 o.add(buildServiceAccount());
768 return o;
769 }
770
771 checkUnnamed1167(core.List<api.ServiceAccount> o) {
772 unittest.expect(o, unittest.hasLength(2));
773 checkServiceAccount(o[0]);
774 checkServiceAccount(o[1]);
775 }
776
777 core.int buildCounterVmParams = 0;
778 buildVmParams() {
779 var o = new api.VmParams();
780 buildCounterVmParams++;
781 if (buildCounterVmParams < 3) {
782 o.baseInstanceName = "foo";
783 o.canIpForward = true;
784 o.description = "foo";
785 o.disksToAttach = buildUnnamed1164();
786 o.disksToCreate = buildUnnamed1165();
787 o.machineType = "foo";
788 o.metadata = buildMetadata();
789 o.networkInterfaces = buildUnnamed1166();
790 o.onHostMaintenance = "foo";
791 o.serviceAccounts = buildUnnamed1167();
792 o.tags = buildTag();
793 }
794 buildCounterVmParams--;
795 return o;
796 }
797
798 checkVmParams(api.VmParams o) {
799 buildCounterVmParams++;
800 if (buildCounterVmParams < 3) {
801 unittest.expect(o.baseInstanceName, unittest.equals('foo'));
802 unittest.expect(o.canIpForward, unittest.isTrue);
803 unittest.expect(o.description, unittest.equals('foo'));
804 checkUnnamed1164(o.disksToAttach);
805 checkUnnamed1165(o.disksToCreate);
806 unittest.expect(o.machineType, unittest.equals('foo'));
807 checkMetadata(o.metadata);
808 checkUnnamed1166(o.networkInterfaces);
809 unittest.expect(o.onHostMaintenance, unittest.equals('foo'));
810 checkUnnamed1167(o.serviceAccounts);
811 checkTag(o.tags);
812 }
813 buildCounterVmParams--;
814 }
815
816
817 main() {
818 unittest.group("obj-schema-AccessConfig", () {
819 unittest.test("to-json--from-json", () {
820 var o = buildAccessConfig();
821 var od = new api.AccessConfig.fromJson(o.toJson());
822 checkAccessConfig(od);
823 });
824 });
825
826
827 unittest.group("obj-schema-Action", () {
828 unittest.test("to-json--from-json", () {
829 var o = buildAction();
830 var od = new api.Action.fromJson(o.toJson());
831 checkAction(od);
832 });
833 });
834
835
836 unittest.group("obj-schema-DiskAttachment", () {
837 unittest.test("to-json--from-json", () {
838 var o = buildDiskAttachment();
839 var od = new api.DiskAttachment.fromJson(o.toJson());
840 checkDiskAttachment(od);
841 });
842 });
843
844
845 unittest.group("obj-schema-EnvVariable", () {
846 unittest.test("to-json--from-json", () {
847 var o = buildEnvVariable();
848 var od = new api.EnvVariable.fromJson(o.toJson());
849 checkEnvVariable(od);
850 });
851 });
852
853
854 unittest.group("obj-schema-ExistingDisk", () {
855 unittest.test("to-json--from-json", () {
856 var o = buildExistingDisk();
857 var od = new api.ExistingDisk.fromJson(o.toJson());
858 checkExistingDisk(od);
859 });
860 });
861
862
863 unittest.group("obj-schema-HealthCheck", () {
864 unittest.test("to-json--from-json", () {
865 var o = buildHealthCheck();
866 var od = new api.HealthCheck.fromJson(o.toJson());
867 checkHealthCheck(od);
868 });
869 });
870
871
872 unittest.group("obj-schema-Label", () {
873 unittest.test("to-json--from-json", () {
874 var o = buildLabel();
875 var od = new api.Label.fromJson(o.toJson());
876 checkLabel(od);
877 });
878 });
879
880
881 unittest.group("obj-schema-Metadata", () {
882 unittest.test("to-json--from-json", () {
883 var o = buildMetadata();
884 var od = new api.Metadata.fromJson(o.toJson());
885 checkMetadata(od);
886 });
887 });
888
889
890 unittest.group("obj-schema-MetadataItem", () {
891 unittest.test("to-json--from-json", () {
892 var o = buildMetadataItem();
893 var od = new api.MetadataItem.fromJson(o.toJson());
894 checkMetadataItem(od);
895 });
896 });
897
898
899 unittest.group("obj-schema-NetworkInterface", () {
900 unittest.test("to-json--from-json", () {
901 var o = buildNetworkInterface();
902 var od = new api.NetworkInterface.fromJson(o.toJson());
903 checkNetworkInterface(od);
904 });
905 });
906
907
908 unittest.group("obj-schema-NewDisk", () {
909 unittest.test("to-json--from-json", () {
910 var o = buildNewDisk();
911 var od = new api.NewDisk.fromJson(o.toJson());
912 checkNewDisk(od);
913 });
914 });
915
916
917 unittest.group("obj-schema-NewDiskInitializeParams", () {
918 unittest.test("to-json--from-json", () {
919 var o = buildNewDiskInitializeParams();
920 var od = new api.NewDiskInitializeParams.fromJson(o.toJson());
921 checkNewDiskInitializeParams(od);
922 });
923 });
924
925
926 unittest.group("obj-schema-Pool", () {
927 unittest.test("to-json--from-json", () {
928 var o = buildPool();
929 var od = new api.Pool.fromJson(o.toJson());
930 checkPool(od);
931 });
932 });
933
934
935 unittest.group("obj-schema-PoolsDeleteRequest", () {
936 unittest.test("to-json--from-json", () {
937 var o = buildPoolsDeleteRequest();
938 var od = new api.PoolsDeleteRequest.fromJson(o.toJson());
939 checkPoolsDeleteRequest(od);
940 });
941 });
942
943
944 unittest.group("obj-schema-PoolsListResponse", () {
945 unittest.test("to-json--from-json", () {
946 var o = buildPoolsListResponse();
947 var od = new api.PoolsListResponse.fromJson(o.toJson());
948 checkPoolsListResponse(od);
949 });
950 });
951
952
953 unittest.group("obj-schema-Replica", () {
954 unittest.test("to-json--from-json", () {
955 var o = buildReplica();
956 var od = new api.Replica.fromJson(o.toJson());
957 checkReplica(od);
958 });
959 });
960
961
962 unittest.group("obj-schema-ReplicaStatus", () {
963 unittest.test("to-json--from-json", () {
964 var o = buildReplicaStatus();
965 var od = new api.ReplicaStatus.fromJson(o.toJson());
966 checkReplicaStatus(od);
967 });
968 });
969
970
971 unittest.group("obj-schema-ReplicasDeleteRequest", () {
972 unittest.test("to-json--from-json", () {
973 var o = buildReplicasDeleteRequest();
974 var od = new api.ReplicasDeleteRequest.fromJson(o.toJson());
975 checkReplicasDeleteRequest(od);
976 });
977 });
978
979
980 unittest.group("obj-schema-ReplicasListResponse", () {
981 unittest.test("to-json--from-json", () {
982 var o = buildReplicasListResponse();
983 var od = new api.ReplicasListResponse.fromJson(o.toJson());
984 checkReplicasListResponse(od);
985 });
986 });
987
988
989 unittest.group("obj-schema-ServiceAccount", () {
990 unittest.test("to-json--from-json", () {
991 var o = buildServiceAccount();
992 var od = new api.ServiceAccount.fromJson(o.toJson());
993 checkServiceAccount(od);
994 });
995 });
996
997
998 unittest.group("obj-schema-Tag", () {
999 unittest.test("to-json--from-json", () {
1000 var o = buildTag();
1001 var od = new api.Tag.fromJson(o.toJson());
1002 checkTag(od);
1003 });
1004 });
1005
1006
1007 unittest.group("obj-schema-Template", () {
1008 unittest.test("to-json--from-json", () {
1009 var o = buildTemplate();
1010 var od = new api.Template.fromJson(o.toJson());
1011 checkTemplate(od);
1012 });
1013 });
1014
1015
1016 unittest.group("obj-schema-VmParams", () {
1017 unittest.test("to-json--from-json", () {
1018 var o = buildVmParams();
1019 var od = new api.VmParams.fromJson(o.toJson());
1020 checkVmParams(od);
1021 });
1022 });
1023
1024
1025 unittest.group("resource-PoolsResourceApi", () {
1026 unittest.test("method--delete", () {
1027
1028 var mock = new common_test.HttpServerMock();
1029 api.PoolsResourceApi res = new api.ReplicapoolApi(mock).pools;
1030 var arg_request = buildPoolsDeleteRequest();
1031 var arg_projectName = "foo";
1032 var arg_zone = "foo";
1033 var arg_poolName = "foo";
1034 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1035 var obj = new api.PoolsDeleteRequest.fromJson(json);
1036 checkPoolsDeleteRequest(obj);
1037
1038 var path = (req.url).path;
1039 var pathOffset = 0;
1040 var index;
1041 var subPart;
1042 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1043 pathOffset += 1;
1044
1045 var query = (req.url).query;
1046 var queryOffset = 0;
1047 var queryMap = {};
1048 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1049 parseBool(n) {
1050 if (n == "true") return true;
1051 if (n == "false") return false;
1052 if (n == null) return null;
1053 throw new core.ArgumentError("Invalid boolean: $n");
1054 }
1055 if (query.length > 0) {
1056 for (var part in query.split("&")) {
1057 var keyvalue = part.split("=");
1058 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1059 }
1060 }
1061
1062
1063 var h = {
1064 "content-type" : "application/json; charset=utf-8",
1065 };
1066 var resp = "";
1067 return new async.Future.value(common_test.stringResponse(200, h, resp));
1068 }), true);
1069 res.delete(arg_request, arg_projectName, arg_zone, arg_poolName).then(unit test.expectAsync((_) {}));
1070 });
1071
1072 unittest.test("method--get", () {
1073
1074 var mock = new common_test.HttpServerMock();
1075 api.PoolsResourceApi res = new api.ReplicapoolApi(mock).pools;
1076 var arg_projectName = "foo";
1077 var arg_zone = "foo";
1078 var arg_poolName = "foo";
1079 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1080 var path = (req.url).path;
1081 var pathOffset = 0;
1082 var index;
1083 var subPart;
1084 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1085 pathOffset += 1;
1086
1087 var query = (req.url).query;
1088 var queryOffset = 0;
1089 var queryMap = {};
1090 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1091 parseBool(n) {
1092 if (n == "true") return true;
1093 if (n == "false") return false;
1094 if (n == null) return null;
1095 throw new core.ArgumentError("Invalid boolean: $n");
1096 }
1097 if (query.length > 0) {
1098 for (var part in query.split("&")) {
1099 var keyvalue = part.split("=");
1100 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1101 }
1102 }
1103
1104
1105 var h = {
1106 "content-type" : "application/json; charset=utf-8",
1107 };
1108 var resp = convert.JSON.encode(buildPool());
1109 return new async.Future.value(common_test.stringResponse(200, h, resp));
1110 }), true);
1111 res.get(arg_projectName, arg_zone, arg_poolName).then(unittest.expectAsync (((api.Pool response) {
1112 checkPool(response);
1113 })));
1114 });
1115
1116 unittest.test("method--insert", () {
1117
1118 var mock = new common_test.HttpServerMock();
1119 api.PoolsResourceApi res = new api.ReplicapoolApi(mock).pools;
1120 var arg_request = buildPool();
1121 var arg_projectName = "foo";
1122 var arg_zone = "foo";
1123 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1124 var obj = new api.Pool.fromJson(json);
1125 checkPool(obj);
1126
1127 var path = (req.url).path;
1128 var pathOffset = 0;
1129 var index;
1130 var subPart;
1131 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1132 pathOffset += 1;
1133
1134 var query = (req.url).query;
1135 var queryOffset = 0;
1136 var queryMap = {};
1137 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1138 parseBool(n) {
1139 if (n == "true") return true;
1140 if (n == "false") return false;
1141 if (n == null) return null;
1142 throw new core.ArgumentError("Invalid boolean: $n");
1143 }
1144 if (query.length > 0) {
1145 for (var part in query.split("&")) {
1146 var keyvalue = part.split("=");
1147 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1148 }
1149 }
1150
1151
1152 var h = {
1153 "content-type" : "application/json; charset=utf-8",
1154 };
1155 var resp = convert.JSON.encode(buildPool());
1156 return new async.Future.value(common_test.stringResponse(200, h, resp));
1157 }), true);
1158 res.insert(arg_request, arg_projectName, arg_zone).then(unittest.expectAsy nc(((api.Pool response) {
1159 checkPool(response);
1160 })));
1161 });
1162
1163 unittest.test("method--list", () {
1164
1165 var mock = new common_test.HttpServerMock();
1166 api.PoolsResourceApi res = new api.ReplicapoolApi(mock).pools;
1167 var arg_projectName = "foo";
1168 var arg_zone = "foo";
1169 var arg_maxResults = 42;
1170 var arg_pageToken = "foo";
1171 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1172 var path = (req.url).path;
1173 var pathOffset = 0;
1174 var index;
1175 var subPart;
1176 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1177 pathOffset += 1;
1178
1179 var query = (req.url).query;
1180 var queryOffset = 0;
1181 var queryMap = {};
1182 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1183 parseBool(n) {
1184 if (n == "true") return true;
1185 if (n == "false") return false;
1186 if (n == null) return null;
1187 throw new core.ArgumentError("Invalid boolean: $n");
1188 }
1189 if (query.length > 0) {
1190 for (var part in query.split("&")) {
1191 var keyvalue = part.split("=");
1192 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1193 }
1194 }
1195 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
1196 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
1197
1198
1199 var h = {
1200 "content-type" : "application/json; charset=utf-8",
1201 };
1202 var resp = convert.JSON.encode(buildPoolsListResponse());
1203 return new async.Future.value(common_test.stringResponse(200, h, resp));
1204 }), true);
1205 res.list(arg_projectName, arg_zone, maxResults: arg_maxResults, pageToken: arg_pageToken).then(unittest.expectAsync(((api.PoolsListResponse response) {
1206 checkPoolsListResponse(response);
1207 })));
1208 });
1209
1210 unittest.test("method--resize", () {
1211
1212 var mock = new common_test.HttpServerMock();
1213 api.PoolsResourceApi res = new api.ReplicapoolApi(mock).pools;
1214 var arg_projectName = "foo";
1215 var arg_zone = "foo";
1216 var arg_poolName = "foo";
1217 var arg_numReplicas = 42;
1218 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1219 var path = (req.url).path;
1220 var pathOffset = 0;
1221 var index;
1222 var subPart;
1223 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1224 pathOffset += 1;
1225
1226 var query = (req.url).query;
1227 var queryOffset = 0;
1228 var queryMap = {};
1229 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1230 parseBool(n) {
1231 if (n == "true") return true;
1232 if (n == "false") return false;
1233 if (n == null) return null;
1234 throw new core.ArgumentError("Invalid boolean: $n");
1235 }
1236 if (query.length > 0) {
1237 for (var part in query.split("&")) {
1238 var keyvalue = part.split("=");
1239 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1240 }
1241 }
1242 unittest.expect(core.int.parse(queryMap["numReplicas"].first), unittest. equals(arg_numReplicas));
1243
1244
1245 var h = {
1246 "content-type" : "application/json; charset=utf-8",
1247 };
1248 var resp = convert.JSON.encode(buildPool());
1249 return new async.Future.value(common_test.stringResponse(200, h, resp));
1250 }), true);
1251 res.resize(arg_projectName, arg_zone, arg_poolName, numReplicas: arg_numRe plicas).then(unittest.expectAsync(((api.Pool response) {
1252 checkPool(response);
1253 })));
1254 });
1255
1256 unittest.test("method--updatetemplate", () {
1257
1258 var mock = new common_test.HttpServerMock();
1259 api.PoolsResourceApi res = new api.ReplicapoolApi(mock).pools;
1260 var arg_request = buildTemplate();
1261 var arg_projectName = "foo";
1262 var arg_zone = "foo";
1263 var arg_poolName = "foo";
1264 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1265 var obj = new api.Template.fromJson(json);
1266 checkTemplate(obj);
1267
1268 var path = (req.url).path;
1269 var pathOffset = 0;
1270 var index;
1271 var subPart;
1272 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1273 pathOffset += 1;
1274
1275 var query = (req.url).query;
1276 var queryOffset = 0;
1277 var queryMap = {};
1278 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1279 parseBool(n) {
1280 if (n == "true") return true;
1281 if (n == "false") return false;
1282 if (n == null) return null;
1283 throw new core.ArgumentError("Invalid boolean: $n");
1284 }
1285 if (query.length > 0) {
1286 for (var part in query.split("&")) {
1287 var keyvalue = part.split("=");
1288 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1289 }
1290 }
1291
1292
1293 var h = {
1294 "content-type" : "application/json; charset=utf-8",
1295 };
1296 var resp = "";
1297 return new async.Future.value(common_test.stringResponse(200, h, resp));
1298 }), true);
1299 res.updatetemplate(arg_request, arg_projectName, arg_zone, arg_poolName).t hen(unittest.expectAsync((_) {}));
1300 });
1301
1302 });
1303
1304
1305 unittest.group("resource-ReplicasResourceApi", () {
1306 unittest.test("method--delete", () {
1307
1308 var mock = new common_test.HttpServerMock();
1309 api.ReplicasResourceApi res = new api.ReplicapoolApi(mock).replicas;
1310 var arg_request = buildReplicasDeleteRequest();
1311 var arg_projectName = "foo";
1312 var arg_zone = "foo";
1313 var arg_poolName = "foo";
1314 var arg_replicaName = "foo";
1315 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1316 var obj = new api.ReplicasDeleteRequest.fromJson(json);
1317 checkReplicasDeleteRequest(obj);
1318
1319 var path = (req.url).path;
1320 var pathOffset = 0;
1321 var index;
1322 var subPart;
1323 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1324 pathOffset += 1;
1325
1326 var query = (req.url).query;
1327 var queryOffset = 0;
1328 var queryMap = {};
1329 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1330 parseBool(n) {
1331 if (n == "true") return true;
1332 if (n == "false") return false;
1333 if (n == null) return null;
1334 throw new core.ArgumentError("Invalid boolean: $n");
1335 }
1336 if (query.length > 0) {
1337 for (var part in query.split("&")) {
1338 var keyvalue = part.split("=");
1339 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1340 }
1341 }
1342
1343
1344 var h = {
1345 "content-type" : "application/json; charset=utf-8",
1346 };
1347 var resp = convert.JSON.encode(buildReplica());
1348 return new async.Future.value(common_test.stringResponse(200, h, resp));
1349 }), true);
1350 res.delete(arg_request, arg_projectName, arg_zone, arg_poolName, arg_repli caName).then(unittest.expectAsync(((api.Replica response) {
1351 checkReplica(response);
1352 })));
1353 });
1354
1355 unittest.test("method--get", () {
1356
1357 var mock = new common_test.HttpServerMock();
1358 api.ReplicasResourceApi res = new api.ReplicapoolApi(mock).replicas;
1359 var arg_projectName = "foo";
1360 var arg_zone = "foo";
1361 var arg_poolName = "foo";
1362 var arg_replicaName = "foo";
1363 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1364 var path = (req.url).path;
1365 var pathOffset = 0;
1366 var index;
1367 var subPart;
1368 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1369 pathOffset += 1;
1370
1371 var query = (req.url).query;
1372 var queryOffset = 0;
1373 var queryMap = {};
1374 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1375 parseBool(n) {
1376 if (n == "true") return true;
1377 if (n == "false") return false;
1378 if (n == null) return null;
1379 throw new core.ArgumentError("Invalid boolean: $n");
1380 }
1381 if (query.length > 0) {
1382 for (var part in query.split("&")) {
1383 var keyvalue = part.split("=");
1384 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1385 }
1386 }
1387
1388
1389 var h = {
1390 "content-type" : "application/json; charset=utf-8",
1391 };
1392 var resp = convert.JSON.encode(buildReplica());
1393 return new async.Future.value(common_test.stringResponse(200, h, resp));
1394 }), true);
1395 res.get(arg_projectName, arg_zone, arg_poolName, arg_replicaName).then(uni ttest.expectAsync(((api.Replica response) {
1396 checkReplica(response);
1397 })));
1398 });
1399
1400 unittest.test("method--list", () {
1401
1402 var mock = new common_test.HttpServerMock();
1403 api.ReplicasResourceApi res = new api.ReplicapoolApi(mock).replicas;
1404 var arg_projectName = "foo";
1405 var arg_zone = "foo";
1406 var arg_poolName = "foo";
1407 var arg_maxResults = 42;
1408 var arg_pageToken = "foo";
1409 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1410 var path = (req.url).path;
1411 var pathOffset = 0;
1412 var index;
1413 var subPart;
1414 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1415 pathOffset += 1;
1416
1417 var query = (req.url).query;
1418 var queryOffset = 0;
1419 var queryMap = {};
1420 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1421 parseBool(n) {
1422 if (n == "true") return true;
1423 if (n == "false") return false;
1424 if (n == null) return null;
1425 throw new core.ArgumentError("Invalid boolean: $n");
1426 }
1427 if (query.length > 0) {
1428 for (var part in query.split("&")) {
1429 var keyvalue = part.split("=");
1430 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1431 }
1432 }
1433 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
1434 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
1435
1436
1437 var h = {
1438 "content-type" : "application/json; charset=utf-8",
1439 };
1440 var resp = convert.JSON.encode(buildReplicasListResponse());
1441 return new async.Future.value(common_test.stringResponse(200, h, resp));
1442 }), true);
1443 res.list(arg_projectName, arg_zone, arg_poolName, maxResults: arg_maxResul ts, pageToken: arg_pageToken).then(unittest.expectAsync(((api.ReplicasListRespon se response) {
1444 checkReplicasListResponse(response);
1445 })));
1446 });
1447
1448 unittest.test("method--restart", () {
1449
1450 var mock = new common_test.HttpServerMock();
1451 api.ReplicasResourceApi res = new api.ReplicapoolApi(mock).replicas;
1452 var arg_projectName = "foo";
1453 var arg_zone = "foo";
1454 var arg_poolName = "foo";
1455 var arg_replicaName = "foo";
1456 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1457 var path = (req.url).path;
1458 var pathOffset = 0;
1459 var index;
1460 var subPart;
1461 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1462 pathOffset += 1;
1463
1464 var query = (req.url).query;
1465 var queryOffset = 0;
1466 var queryMap = {};
1467 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1468 parseBool(n) {
1469 if (n == "true") return true;
1470 if (n == "false") return false;
1471 if (n == null) return null;
1472 throw new core.ArgumentError("Invalid boolean: $n");
1473 }
1474 if (query.length > 0) {
1475 for (var part in query.split("&")) {
1476 var keyvalue = part.split("=");
1477 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1478 }
1479 }
1480
1481
1482 var h = {
1483 "content-type" : "application/json; charset=utf-8",
1484 };
1485 var resp = convert.JSON.encode(buildReplica());
1486 return new async.Future.value(common_test.stringResponse(200, h, resp));
1487 }), true);
1488 res.restart(arg_projectName, arg_zone, arg_poolName, arg_replicaName).then (unittest.expectAsync(((api.Replica response) {
1489 checkReplica(response);
1490 })));
1491 });
1492
1493 });
1494
1495
1496 }
1497
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698