OLD | NEW |
1 library googleapis.container.v1.test; | 1 library googleapis.container.v1.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; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map headers, core.String body) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 52 } |
53 | 53 |
54 buildUnnamed649() { | 54 buildUnnamed1482() { |
55 var o = new core.List<core.String>(); | 55 var o = new core.List<core.String>(); |
56 o.add("foo"); | 56 o.add("foo"); |
57 o.add("foo"); | 57 o.add("foo"); |
58 return o; | 58 return o; |
59 } | 59 } |
60 | 60 |
61 checkUnnamed649(core.List<core.String> o) { | 61 checkUnnamed1482(core.List<core.String> o) { |
62 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
63 unittest.expect(o[0], unittest.equals('foo')); | 63 unittest.expect(o[0], unittest.equals('foo')); |
64 unittest.expect(o[1], unittest.equals('foo')); | 64 unittest.expect(o[1], unittest.equals('foo')); |
65 } | 65 } |
66 | 66 |
67 core.int buildCounterCluster = 0; | 67 core.int buildCounterCluster = 0; |
68 buildCluster() { | 68 buildCluster() { |
69 var o = new api.Cluster(); | 69 var o = new api.Cluster(); |
70 buildCounterCluster++; | 70 buildCounterCluster++; |
71 if (buildCounterCluster < 3) { | 71 if (buildCounterCluster < 3) { |
72 o.clusterIpv4Cidr = "foo"; | 72 o.clusterIpv4Cidr = "foo"; |
73 o.createTime = "foo"; | 73 o.createTime = "foo"; |
74 o.currentMasterVersion = "foo"; | 74 o.currentMasterVersion = "foo"; |
75 o.currentNodeVersion = "foo"; | 75 o.currentNodeVersion = "foo"; |
76 o.description = "foo"; | 76 o.description = "foo"; |
77 o.endpoint = "foo"; | 77 o.endpoint = "foo"; |
78 o.initialClusterVersion = "foo"; | 78 o.initialClusterVersion = "foo"; |
79 o.initialNodeCount = 42; | 79 o.initialNodeCount = 42; |
80 o.instanceGroupUrls = buildUnnamed649(); | 80 o.instanceGroupUrls = buildUnnamed1482(); |
81 o.loggingService = "foo"; | 81 o.loggingService = "foo"; |
82 o.masterAuth = buildMasterAuth(); | 82 o.masterAuth = buildMasterAuth(); |
83 o.monitoringService = "foo"; | 83 o.monitoringService = "foo"; |
84 o.name = "foo"; | 84 o.name = "foo"; |
85 o.network = "foo"; | 85 o.network = "foo"; |
86 o.nodeConfig = buildNodeConfig(); | 86 o.nodeConfig = buildNodeConfig(); |
87 o.nodeIpv4CidrSize = 42; | 87 o.nodeIpv4CidrSize = 42; |
88 o.selfLink = "foo"; | 88 o.selfLink = "foo"; |
89 o.servicesIpv4Cidr = "foo"; | 89 o.servicesIpv4Cidr = "foo"; |
90 o.status = "foo"; | 90 o.status = "foo"; |
91 o.statusMessage = "foo"; | 91 o.statusMessage = "foo"; |
92 o.zone = "foo"; | 92 o.zone = "foo"; |
93 } | 93 } |
94 buildCounterCluster--; | 94 buildCounterCluster--; |
95 return o; | 95 return o; |
96 } | 96 } |
97 | 97 |
98 checkCluster(api.Cluster o) { | 98 checkCluster(api.Cluster o) { |
99 buildCounterCluster++; | 99 buildCounterCluster++; |
100 if (buildCounterCluster < 3) { | 100 if (buildCounterCluster < 3) { |
101 unittest.expect(o.clusterIpv4Cidr, unittest.equals('foo')); | 101 unittest.expect(o.clusterIpv4Cidr, unittest.equals('foo')); |
102 unittest.expect(o.createTime, unittest.equals('foo')); | 102 unittest.expect(o.createTime, unittest.equals('foo')); |
103 unittest.expect(o.currentMasterVersion, unittest.equals('foo')); | 103 unittest.expect(o.currentMasterVersion, unittest.equals('foo')); |
104 unittest.expect(o.currentNodeVersion, unittest.equals('foo')); | 104 unittest.expect(o.currentNodeVersion, unittest.equals('foo')); |
105 unittest.expect(o.description, unittest.equals('foo')); | 105 unittest.expect(o.description, unittest.equals('foo')); |
106 unittest.expect(o.endpoint, unittest.equals('foo')); | 106 unittest.expect(o.endpoint, unittest.equals('foo')); |
107 unittest.expect(o.initialClusterVersion, unittest.equals('foo')); | 107 unittest.expect(o.initialClusterVersion, unittest.equals('foo')); |
108 unittest.expect(o.initialNodeCount, unittest.equals(42)); | 108 unittest.expect(o.initialNodeCount, unittest.equals(42)); |
109 checkUnnamed649(o.instanceGroupUrls); | 109 checkUnnamed1482(o.instanceGroupUrls); |
110 unittest.expect(o.loggingService, unittest.equals('foo')); | 110 unittest.expect(o.loggingService, unittest.equals('foo')); |
111 checkMasterAuth(o.masterAuth); | 111 checkMasterAuth(o.masterAuth); |
112 unittest.expect(o.monitoringService, unittest.equals('foo')); | 112 unittest.expect(o.monitoringService, unittest.equals('foo')); |
113 unittest.expect(o.name, unittest.equals('foo')); | 113 unittest.expect(o.name, unittest.equals('foo')); |
114 unittest.expect(o.network, unittest.equals('foo')); | 114 unittest.expect(o.network, unittest.equals('foo')); |
115 checkNodeConfig(o.nodeConfig); | 115 checkNodeConfig(o.nodeConfig); |
116 unittest.expect(o.nodeIpv4CidrSize, unittest.equals(42)); | 116 unittest.expect(o.nodeIpv4CidrSize, unittest.equals(42)); |
117 unittest.expect(o.selfLink, unittest.equals('foo')); | 117 unittest.expect(o.selfLink, unittest.equals('foo')); |
118 unittest.expect(o.servicesIpv4Cidr, unittest.equals('foo')); | 118 unittest.expect(o.servicesIpv4Cidr, unittest.equals('foo')); |
119 unittest.expect(o.status, unittest.equals('foo')); | 119 unittest.expect(o.status, unittest.equals('foo')); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } | 154 } |
155 | 155 |
156 checkCreateClusterRequest(api.CreateClusterRequest o) { | 156 checkCreateClusterRequest(api.CreateClusterRequest o) { |
157 buildCounterCreateClusterRequest++; | 157 buildCounterCreateClusterRequest++; |
158 if (buildCounterCreateClusterRequest < 3) { | 158 if (buildCounterCreateClusterRequest < 3) { |
159 checkCluster(o.cluster); | 159 checkCluster(o.cluster); |
160 } | 160 } |
161 buildCounterCreateClusterRequest--; | 161 buildCounterCreateClusterRequest--; |
162 } | 162 } |
163 | 163 |
164 buildUnnamed650() { | 164 buildUnnamed1483() { |
165 var o = new core.List<api.Cluster>(); | 165 var o = new core.List<api.Cluster>(); |
166 o.add(buildCluster()); | 166 o.add(buildCluster()); |
167 o.add(buildCluster()); | 167 o.add(buildCluster()); |
168 return o; | 168 return o; |
169 } | 169 } |
170 | 170 |
171 checkUnnamed650(core.List<api.Cluster> o) { | 171 checkUnnamed1483(core.List<api.Cluster> o) { |
172 unittest.expect(o, unittest.hasLength(2)); | 172 unittest.expect(o, unittest.hasLength(2)); |
173 checkCluster(o[0]); | 173 checkCluster(o[0]); |
174 checkCluster(o[1]); | 174 checkCluster(o[1]); |
175 } | 175 } |
176 | 176 |
177 core.int buildCounterListClustersResponse = 0; | 177 core.int buildCounterListClustersResponse = 0; |
178 buildListClustersResponse() { | 178 buildListClustersResponse() { |
179 var o = new api.ListClustersResponse(); | 179 var o = new api.ListClustersResponse(); |
180 buildCounterListClustersResponse++; | 180 buildCounterListClustersResponse++; |
181 if (buildCounterListClustersResponse < 3) { | 181 if (buildCounterListClustersResponse < 3) { |
182 o.clusters = buildUnnamed650(); | 182 o.clusters = buildUnnamed1483(); |
183 } | 183 } |
184 buildCounterListClustersResponse--; | 184 buildCounterListClustersResponse--; |
185 return o; | 185 return o; |
186 } | 186 } |
187 | 187 |
188 checkListClustersResponse(api.ListClustersResponse o) { | 188 checkListClustersResponse(api.ListClustersResponse o) { |
189 buildCounterListClustersResponse++; | 189 buildCounterListClustersResponse++; |
190 if (buildCounterListClustersResponse < 3) { | 190 if (buildCounterListClustersResponse < 3) { |
191 checkUnnamed650(o.clusters); | 191 checkUnnamed1483(o.clusters); |
192 } | 192 } |
193 buildCounterListClustersResponse--; | 193 buildCounterListClustersResponse--; |
194 } | 194 } |
195 | 195 |
196 buildUnnamed651() { | 196 buildUnnamed1484() { |
197 var o = new core.List<api.Operation>(); | 197 var o = new core.List<api.Operation>(); |
198 o.add(buildOperation()); | 198 o.add(buildOperation()); |
199 o.add(buildOperation()); | 199 o.add(buildOperation()); |
200 return o; | 200 return o; |
201 } | 201 } |
202 | 202 |
203 checkUnnamed651(core.List<api.Operation> o) { | 203 checkUnnamed1484(core.List<api.Operation> o) { |
204 unittest.expect(o, unittest.hasLength(2)); | 204 unittest.expect(o, unittest.hasLength(2)); |
205 checkOperation(o[0]); | 205 checkOperation(o[0]); |
206 checkOperation(o[1]); | 206 checkOperation(o[1]); |
207 } | 207 } |
208 | 208 |
209 core.int buildCounterListOperationsResponse = 0; | 209 core.int buildCounterListOperationsResponse = 0; |
210 buildListOperationsResponse() { | 210 buildListOperationsResponse() { |
211 var o = new api.ListOperationsResponse(); | 211 var o = new api.ListOperationsResponse(); |
212 buildCounterListOperationsResponse++; | 212 buildCounterListOperationsResponse++; |
213 if (buildCounterListOperationsResponse < 3) { | 213 if (buildCounterListOperationsResponse < 3) { |
214 o.operations = buildUnnamed651(); | 214 o.operations = buildUnnamed1484(); |
215 } | 215 } |
216 buildCounterListOperationsResponse--; | 216 buildCounterListOperationsResponse--; |
217 return o; | 217 return o; |
218 } | 218 } |
219 | 219 |
220 checkListOperationsResponse(api.ListOperationsResponse o) { | 220 checkListOperationsResponse(api.ListOperationsResponse o) { |
221 buildCounterListOperationsResponse++; | 221 buildCounterListOperationsResponse++; |
222 if (buildCounterListOperationsResponse < 3) { | 222 if (buildCounterListOperationsResponse < 3) { |
223 checkUnnamed651(o.operations); | 223 checkUnnamed1484(o.operations); |
224 } | 224 } |
225 buildCounterListOperationsResponse--; | 225 buildCounterListOperationsResponse--; |
226 } | 226 } |
227 | 227 |
228 core.int buildCounterMasterAuth = 0; | 228 core.int buildCounterMasterAuth = 0; |
229 buildMasterAuth() { | 229 buildMasterAuth() { |
230 var o = new api.MasterAuth(); | 230 var o = new api.MasterAuth(); |
231 buildCounterMasterAuth++; | 231 buildCounterMasterAuth++; |
232 if (buildCounterMasterAuth < 3) { | 232 if (buildCounterMasterAuth < 3) { |
233 o.clientCertificate = "foo"; | 233 o.clientCertificate = "foo"; |
(...skipping 11 matching lines...) Expand all Loading... |
245 if (buildCounterMasterAuth < 3) { | 245 if (buildCounterMasterAuth < 3) { |
246 unittest.expect(o.clientCertificate, unittest.equals('foo')); | 246 unittest.expect(o.clientCertificate, unittest.equals('foo')); |
247 unittest.expect(o.clientKey, unittest.equals('foo')); | 247 unittest.expect(o.clientKey, unittest.equals('foo')); |
248 unittest.expect(o.clusterCaCertificate, unittest.equals('foo')); | 248 unittest.expect(o.clusterCaCertificate, unittest.equals('foo')); |
249 unittest.expect(o.password, unittest.equals('foo')); | 249 unittest.expect(o.password, unittest.equals('foo')); |
250 unittest.expect(o.username, unittest.equals('foo')); | 250 unittest.expect(o.username, unittest.equals('foo')); |
251 } | 251 } |
252 buildCounterMasterAuth--; | 252 buildCounterMasterAuth--; |
253 } | 253 } |
254 | 254 |
255 buildUnnamed652() { | 255 buildUnnamed1485() { |
256 var o = new core.List<core.String>(); | 256 var o = new core.List<core.String>(); |
257 o.add("foo"); | 257 o.add("foo"); |
258 o.add("foo"); | 258 o.add("foo"); |
259 return o; | 259 return o; |
260 } | 260 } |
261 | 261 |
262 checkUnnamed652(core.List<core.String> o) { | 262 checkUnnamed1485(core.List<core.String> o) { |
263 unittest.expect(o, unittest.hasLength(2)); | 263 unittest.expect(o, unittest.hasLength(2)); |
264 unittest.expect(o[0], unittest.equals('foo')); | 264 unittest.expect(o[0], unittest.equals('foo')); |
265 unittest.expect(o[1], unittest.equals('foo')); | 265 unittest.expect(o[1], unittest.equals('foo')); |
266 } | 266 } |
267 | 267 |
268 core.int buildCounterNodeConfig = 0; | 268 core.int buildCounterNodeConfig = 0; |
269 buildNodeConfig() { | 269 buildNodeConfig() { |
270 var o = new api.NodeConfig(); | 270 var o = new api.NodeConfig(); |
271 buildCounterNodeConfig++; | 271 buildCounterNodeConfig++; |
272 if (buildCounterNodeConfig < 3) { | 272 if (buildCounterNodeConfig < 3) { |
273 o.diskSizeGb = 42; | 273 o.diskSizeGb = 42; |
274 o.machineType = "foo"; | 274 o.machineType = "foo"; |
275 o.oauthScopes = buildUnnamed652(); | 275 o.oauthScopes = buildUnnamed1485(); |
276 } | 276 } |
277 buildCounterNodeConfig--; | 277 buildCounterNodeConfig--; |
278 return o; | 278 return o; |
279 } | 279 } |
280 | 280 |
281 checkNodeConfig(api.NodeConfig o) { | 281 checkNodeConfig(api.NodeConfig o) { |
282 buildCounterNodeConfig++; | 282 buildCounterNodeConfig++; |
283 if (buildCounterNodeConfig < 3) { | 283 if (buildCounterNodeConfig < 3) { |
284 unittest.expect(o.diskSizeGb, unittest.equals(42)); | 284 unittest.expect(o.diskSizeGb, unittest.equals(42)); |
285 unittest.expect(o.machineType, unittest.equals('foo')); | 285 unittest.expect(o.machineType, unittest.equals('foo')); |
286 checkUnnamed652(o.oauthScopes); | 286 checkUnnamed1485(o.oauthScopes); |
287 } | 287 } |
288 buildCounterNodeConfig--; | 288 buildCounterNodeConfig--; |
289 } | 289 } |
290 | 290 |
291 core.int buildCounterOperation = 0; | 291 core.int buildCounterOperation = 0; |
292 buildOperation() { | 292 buildOperation() { |
293 var o = new api.Operation(); | 293 var o = new api.Operation(); |
294 buildCounterOperation++; | 294 buildCounterOperation++; |
295 if (buildCounterOperation < 3) { | 295 if (buildCounterOperation < 3) { |
296 o.name = "foo"; | 296 o.name = "foo"; |
(...skipping 15 matching lines...) Expand all Loading... |
312 unittest.expect(o.operationType, unittest.equals('foo')); | 312 unittest.expect(o.operationType, unittest.equals('foo')); |
313 unittest.expect(o.selfLink, unittest.equals('foo')); | 313 unittest.expect(o.selfLink, unittest.equals('foo')); |
314 unittest.expect(o.status, unittest.equals('foo')); | 314 unittest.expect(o.status, unittest.equals('foo')); |
315 unittest.expect(o.statusMessage, unittest.equals('foo')); | 315 unittest.expect(o.statusMessage, unittest.equals('foo')); |
316 unittest.expect(o.targetLink, unittest.equals('foo')); | 316 unittest.expect(o.targetLink, unittest.equals('foo')); |
317 unittest.expect(o.zone, unittest.equals('foo')); | 317 unittest.expect(o.zone, unittest.equals('foo')); |
318 } | 318 } |
319 buildCounterOperation--; | 319 buildCounterOperation--; |
320 } | 320 } |
321 | 321 |
| 322 buildUnnamed1486() { |
| 323 var o = new core.List<core.String>(); |
| 324 o.add("foo"); |
| 325 o.add("foo"); |
| 326 return o; |
| 327 } |
| 328 |
| 329 checkUnnamed1486(core.List<core.String> o) { |
| 330 unittest.expect(o, unittest.hasLength(2)); |
| 331 unittest.expect(o[0], unittest.equals('foo')); |
| 332 unittest.expect(o[1], unittest.equals('foo')); |
| 333 } |
| 334 |
| 335 core.int buildCounterServerConfig = 0; |
| 336 buildServerConfig() { |
| 337 var o = new api.ServerConfig(); |
| 338 buildCounterServerConfig++; |
| 339 if (buildCounterServerConfig < 3) { |
| 340 o.defaultClusterVersion = "foo"; |
| 341 o.validNodeVersions = buildUnnamed1486(); |
| 342 } |
| 343 buildCounterServerConfig--; |
| 344 return o; |
| 345 } |
| 346 |
| 347 checkServerConfig(api.ServerConfig o) { |
| 348 buildCounterServerConfig++; |
| 349 if (buildCounterServerConfig < 3) { |
| 350 unittest.expect(o.defaultClusterVersion, unittest.equals('foo')); |
| 351 checkUnnamed1486(o.validNodeVersions); |
| 352 } |
| 353 buildCounterServerConfig--; |
| 354 } |
| 355 |
322 core.int buildCounterUpdateClusterRequest = 0; | 356 core.int buildCounterUpdateClusterRequest = 0; |
323 buildUpdateClusterRequest() { | 357 buildUpdateClusterRequest() { |
324 var o = new api.UpdateClusterRequest(); | 358 var o = new api.UpdateClusterRequest(); |
325 buildCounterUpdateClusterRequest++; | 359 buildCounterUpdateClusterRequest++; |
326 if (buildCounterUpdateClusterRequest < 3) { | 360 if (buildCounterUpdateClusterRequest < 3) { |
327 o.update = buildClusterUpdate(); | 361 o.update = buildClusterUpdate(); |
328 } | 362 } |
329 buildCounterUpdateClusterRequest--; | 363 buildCounterUpdateClusterRequest--; |
330 return o; | 364 return o; |
331 } | 365 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 | 439 |
406 unittest.group("obj-schema-Operation", () { | 440 unittest.group("obj-schema-Operation", () { |
407 unittest.test("to-json--from-json", () { | 441 unittest.test("to-json--from-json", () { |
408 var o = buildOperation(); | 442 var o = buildOperation(); |
409 var od = new api.Operation.fromJson(o.toJson()); | 443 var od = new api.Operation.fromJson(o.toJson()); |
410 checkOperation(od); | 444 checkOperation(od); |
411 }); | 445 }); |
412 }); | 446 }); |
413 | 447 |
414 | 448 |
| 449 unittest.group("obj-schema-ServerConfig", () { |
| 450 unittest.test("to-json--from-json", () { |
| 451 var o = buildServerConfig(); |
| 452 var od = new api.ServerConfig.fromJson(o.toJson()); |
| 453 checkServerConfig(od); |
| 454 }); |
| 455 }); |
| 456 |
| 457 |
415 unittest.group("obj-schema-UpdateClusterRequest", () { | 458 unittest.group("obj-schema-UpdateClusterRequest", () { |
416 unittest.test("to-json--from-json", () { | 459 unittest.test("to-json--from-json", () { |
417 var o = buildUpdateClusterRequest(); | 460 var o = buildUpdateClusterRequest(); |
418 var od = new api.UpdateClusterRequest.fromJson(o.toJson()); | 461 var od = new api.UpdateClusterRequest.fromJson(o.toJson()); |
419 checkUpdateClusterRequest(od); | 462 checkUpdateClusterRequest(od); |
420 }); | 463 }); |
421 }); | 464 }); |
422 | 465 |
423 | 466 |
| 467 unittest.group("resource-ProjectsZonesResourceApi", () { |
| 468 unittest.test("method--getServerconfig", () { |
| 469 |
| 470 var mock = new HttpServerMock(); |
| 471 api.ProjectsZonesResourceApi res = new api.ContainerApi(mock).projects.zon
es; |
| 472 var arg_projectId = "foo"; |
| 473 var arg_zone = "foo"; |
| 474 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 475 var path = (req.url).path; |
| 476 var pathOffset = 0; |
| 477 var index; |
| 478 var subPart; |
| 479 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 480 pathOffset += 1; |
| 481 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); |
| 482 pathOffset += 12; |
| 483 index = path.indexOf("/zones/", pathOffset); |
| 484 unittest.expect(index >= 0, unittest.isTrue); |
| 485 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 486 pathOffset = index; |
| 487 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 488 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); |
| 489 pathOffset += 7; |
| 490 index = path.indexOf("/serverconfig", pathOffset); |
| 491 unittest.expect(index >= 0, unittest.isTrue); |
| 492 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 493 pathOffset = index; |
| 494 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 495 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/serverconfig")); |
| 496 pathOffset += 13; |
| 497 |
| 498 var query = (req.url).query; |
| 499 var queryOffset = 0; |
| 500 var queryMap = {}; |
| 501 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 502 parseBool(n) { |
| 503 if (n == "true") return true; |
| 504 if (n == "false") return false; |
| 505 if (n == null) return null; |
| 506 throw new core.ArgumentError("Invalid boolean: $n"); |
| 507 } |
| 508 if (query.length > 0) { |
| 509 for (var part in query.split("&")) { |
| 510 var keyvalue = part.split("="); |
| 511 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 512 } |
| 513 } |
| 514 |
| 515 |
| 516 var h = { |
| 517 "content-type" : "application/json; charset=utf-8", |
| 518 }; |
| 519 var resp = convert.JSON.encode(buildServerConfig()); |
| 520 return new async.Future.value(stringResponse(200, h, resp)); |
| 521 }), true); |
| 522 res.getServerconfig(arg_projectId, arg_zone).then(unittest.expectAsync(((a
pi.ServerConfig response) { |
| 523 checkServerConfig(response); |
| 524 }))); |
| 525 }); |
| 526 |
| 527 }); |
| 528 |
| 529 |
424 unittest.group("resource-ProjectsZonesClustersResourceApi", () { | 530 unittest.group("resource-ProjectsZonesClustersResourceApi", () { |
425 unittest.test("method--create", () { | 531 unittest.test("method--create", () { |
426 | 532 |
427 var mock = new HttpServerMock(); | 533 var mock = new HttpServerMock(); |
428 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 534 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; |
429 var arg_request = buildCreateClusterRequest(); | 535 var arg_request = buildCreateClusterRequest(); |
430 var arg_projectId = "foo"; | 536 var arg_projectId = "foo"; |
431 var arg_zone = "foo"; | 537 var arg_zone = "foo"; |
432 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 538 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
433 var obj = new api.CreateClusterRequest.fromJson(json); | 539 var obj = new api.CreateClusterRequest.fromJson(json); |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 res.list(arg_projectId, arg_zone).then(unittest.expectAsync(((api.ListOper
ationsResponse response) { | 967 res.list(arg_projectId, arg_zone).then(unittest.expectAsync(((api.ListOper
ationsResponse response) { |
862 checkListOperationsResponse(response); | 968 checkListOperationsResponse(response); |
863 }))); | 969 }))); |
864 }); | 970 }); |
865 | 971 |
866 }); | 972 }); |
867 | 973 |
868 | 974 |
869 } | 975 } |
870 | 976 |
OLD | NEW |