OLD | NEW |
1 library googleapis_beta.deploymentmanager.v2beta1.test; | 1 library googleapis_beta.deploymentmanager.v2beta2.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 | 11 |
12 import 'package:googleapis_beta/deploymentmanager/v2beta1.dart' as api; | 12 import 'package:googleapis_beta/deploymentmanager/v2beta2.dart' as api; |
13 | 13 |
14 class HttpServerMock extends http.BaseClient { | 14 class HttpServerMock extends http.BaseClient { |
15 core.Function _callback; | 15 core.Function _callback; |
16 core.bool _expectJson; | 16 core.bool _expectJson; |
17 | 17 |
18 void register(core.Function callback, core.bool expectJson) { | 18 void register(core.Function callback, core.bool expectJson) { |
19 _callback = callback; | 19 _callback = callback; |
20 _expectJson = expectJson; | 20 _expectJson = expectJson; |
21 } | 21 } |
22 | 22 |
(...skipping 27 matching lines...) Loading... |
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 core.int buildCounterDeployment = 0; | 54 core.int buildCounterDeployment = 0; |
55 buildDeployment() { | 55 buildDeployment() { |
56 var o = new api.Deployment(); | 56 var o = new api.Deployment(); |
57 buildCounterDeployment++; | 57 buildCounterDeployment++; |
58 if (buildCounterDeployment < 3) { | 58 if (buildCounterDeployment < 3) { |
59 o.description = "foo"; | 59 o.description = "foo"; |
| 60 o.fingerprint = "foo"; |
60 o.id = "foo"; | 61 o.id = "foo"; |
| 62 o.insertTime = "foo"; |
| 63 o.intent = "foo"; |
61 o.manifest = "foo"; | 64 o.manifest = "foo"; |
62 o.name = "foo"; | 65 o.name = "foo"; |
63 o.targetConfig = "foo"; | 66 o.state = "foo"; |
| 67 o.target = buildTargetConfiguration(); |
| 68 o.update = buildDeploymentUpdate(); |
| 69 o.updateTime = "foo"; |
64 } | 70 } |
65 buildCounterDeployment--; | 71 buildCounterDeployment--; |
66 return o; | 72 return o; |
67 } | 73 } |
68 | 74 |
69 checkDeployment(api.Deployment o) { | 75 checkDeployment(api.Deployment o) { |
70 buildCounterDeployment++; | 76 buildCounterDeployment++; |
71 if (buildCounterDeployment < 3) { | 77 if (buildCounterDeployment < 3) { |
72 unittest.expect(o.description, unittest.equals('foo')); | 78 unittest.expect(o.description, unittest.equals('foo')); |
| 79 unittest.expect(o.fingerprint, unittest.equals('foo')); |
73 unittest.expect(o.id, unittest.equals('foo')); | 80 unittest.expect(o.id, unittest.equals('foo')); |
| 81 unittest.expect(o.insertTime, unittest.equals('foo')); |
| 82 unittest.expect(o.intent, unittest.equals('foo')); |
74 unittest.expect(o.manifest, unittest.equals('foo')); | 83 unittest.expect(o.manifest, unittest.equals('foo')); |
75 unittest.expect(o.name, unittest.equals('foo')); | 84 unittest.expect(o.name, unittest.equals('foo')); |
76 unittest.expect(o.targetConfig, unittest.equals('foo')); | 85 unittest.expect(o.state, unittest.equals('foo')); |
| 86 checkTargetConfiguration(o.target); |
| 87 checkDeploymentUpdate(o.update); |
| 88 unittest.expect(o.updateTime, unittest.equals('foo')); |
77 } | 89 } |
78 buildCounterDeployment--; | 90 buildCounterDeployment--; |
79 } | 91 } |
80 | 92 |
81 buildUnnamed1656() { | 93 buildUnnamed2354() { |
| 94 var o = new core.List<core.String>(); |
| 95 o.add("foo"); |
| 96 o.add("foo"); |
| 97 return o; |
| 98 } |
| 99 |
| 100 checkUnnamed2354(core.List<core.String> o) { |
| 101 unittest.expect(o, unittest.hasLength(2)); |
| 102 unittest.expect(o[0], unittest.equals('foo')); |
| 103 unittest.expect(o[1], unittest.equals('foo')); |
| 104 } |
| 105 |
| 106 core.int buildCounterDeploymentUpdate = 0; |
| 107 buildDeploymentUpdate() { |
| 108 var o = new api.DeploymentUpdate(); |
| 109 buildCounterDeploymentUpdate++; |
| 110 if (buildCounterDeploymentUpdate < 3) { |
| 111 o.errors = buildUnnamed2354(); |
| 112 o.manifest = "foo"; |
| 113 } |
| 114 buildCounterDeploymentUpdate--; |
| 115 return o; |
| 116 } |
| 117 |
| 118 checkDeploymentUpdate(api.DeploymentUpdate o) { |
| 119 buildCounterDeploymentUpdate++; |
| 120 if (buildCounterDeploymentUpdate < 3) { |
| 121 checkUnnamed2354(o.errors); |
| 122 unittest.expect(o.manifest, unittest.equals('foo')); |
| 123 } |
| 124 buildCounterDeploymentUpdate--; |
| 125 } |
| 126 |
| 127 buildUnnamed2355() { |
82 var o = new core.List<api.Deployment>(); | 128 var o = new core.List<api.Deployment>(); |
83 o.add(buildDeployment()); | 129 o.add(buildDeployment()); |
84 o.add(buildDeployment()); | 130 o.add(buildDeployment()); |
85 return o; | 131 return o; |
86 } | 132 } |
87 | 133 |
88 checkUnnamed1656(core.List<api.Deployment> o) { | 134 checkUnnamed2355(core.List<api.Deployment> o) { |
89 unittest.expect(o, unittest.hasLength(2)); | 135 unittest.expect(o, unittest.hasLength(2)); |
90 checkDeployment(o[0]); | 136 checkDeployment(o[0]); |
91 checkDeployment(o[1]); | 137 checkDeployment(o[1]); |
92 } | 138 } |
93 | 139 |
94 core.int buildCounterDeploymentsListResponse = 0; | 140 core.int buildCounterDeploymentsListResponse = 0; |
95 buildDeploymentsListResponse() { | 141 buildDeploymentsListResponse() { |
96 var o = new api.DeploymentsListResponse(); | 142 var o = new api.DeploymentsListResponse(); |
97 buildCounterDeploymentsListResponse++; | 143 buildCounterDeploymentsListResponse++; |
98 if (buildCounterDeploymentsListResponse < 3) { | 144 if (buildCounterDeploymentsListResponse < 3) { |
99 o.deployments = buildUnnamed1656(); | 145 o.deployments = buildUnnamed2355(); |
100 o.nextPageToken = "foo"; | 146 o.nextPageToken = "foo"; |
101 } | 147 } |
102 buildCounterDeploymentsListResponse--; | 148 buildCounterDeploymentsListResponse--; |
103 return o; | 149 return o; |
104 } | 150 } |
105 | 151 |
106 checkDeploymentsListResponse(api.DeploymentsListResponse o) { | 152 checkDeploymentsListResponse(api.DeploymentsListResponse o) { |
107 buildCounterDeploymentsListResponse++; | 153 buildCounterDeploymentsListResponse++; |
108 if (buildCounterDeploymentsListResponse < 3) { | 154 if (buildCounterDeploymentsListResponse < 3) { |
109 checkUnnamed1656(o.deployments); | 155 checkUnnamed2355(o.deployments); |
110 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 156 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
111 } | 157 } |
112 buildCounterDeploymentsListResponse--; | 158 buildCounterDeploymentsListResponse--; |
113 } | 159 } |
114 | 160 |
| 161 core.int buildCounterImportFile = 0; |
| 162 buildImportFile() { |
| 163 var o = new api.ImportFile(); |
| 164 buildCounterImportFile++; |
| 165 if (buildCounterImportFile < 3) { |
| 166 o.content = "foo"; |
| 167 o.name = "foo"; |
| 168 } |
| 169 buildCounterImportFile--; |
| 170 return o; |
| 171 } |
| 172 |
| 173 checkImportFile(api.ImportFile o) { |
| 174 buildCounterImportFile++; |
| 175 if (buildCounterImportFile < 3) { |
| 176 unittest.expect(o.content, unittest.equals('foo')); |
| 177 unittest.expect(o.name, unittest.equals('foo')); |
| 178 } |
| 179 buildCounterImportFile--; |
| 180 } |
| 181 |
| 182 buildUnnamed2356() { |
| 183 var o = new core.List<api.ImportFile>(); |
| 184 o.add(buildImportFile()); |
| 185 o.add(buildImportFile()); |
| 186 return o; |
| 187 } |
| 188 |
| 189 checkUnnamed2356(core.List<api.ImportFile> o) { |
| 190 unittest.expect(o, unittest.hasLength(2)); |
| 191 checkImportFile(o[0]); |
| 192 checkImportFile(o[1]); |
| 193 } |
| 194 |
115 core.int buildCounterManifest = 0; | 195 core.int buildCounterManifest = 0; |
116 buildManifest() { | 196 buildManifest() { |
117 var o = new api.Manifest(); | 197 var o = new api.Manifest(); |
118 buildCounterManifest++; | 198 buildCounterManifest++; |
119 if (buildCounterManifest < 3) { | 199 if (buildCounterManifest < 3) { |
120 o.config = "foo"; | 200 o.config = "foo"; |
121 o.evaluatedConfig = "foo"; | 201 o.evaluatedConfig = "foo"; |
122 o.id = "foo"; | 202 o.id = "foo"; |
| 203 o.imports = buildUnnamed2356(); |
| 204 o.insertTime = "foo"; |
| 205 o.layout = "foo"; |
123 o.name = "foo"; | 206 o.name = "foo"; |
124 o.selfLink = "foo"; | 207 o.selfLink = "foo"; |
125 } | 208 } |
126 buildCounterManifest--; | 209 buildCounterManifest--; |
127 return o; | 210 return o; |
128 } | 211 } |
129 | 212 |
130 checkManifest(api.Manifest o) { | 213 checkManifest(api.Manifest o) { |
131 buildCounterManifest++; | 214 buildCounterManifest++; |
132 if (buildCounterManifest < 3) { | 215 if (buildCounterManifest < 3) { |
133 unittest.expect(o.config, unittest.equals('foo')); | 216 unittest.expect(o.config, unittest.equals('foo')); |
134 unittest.expect(o.evaluatedConfig, unittest.equals('foo')); | 217 unittest.expect(o.evaluatedConfig, unittest.equals('foo')); |
135 unittest.expect(o.id, unittest.equals('foo')); | 218 unittest.expect(o.id, unittest.equals('foo')); |
| 219 checkUnnamed2356(o.imports); |
| 220 unittest.expect(o.insertTime, unittest.equals('foo')); |
| 221 unittest.expect(o.layout, unittest.equals('foo')); |
136 unittest.expect(o.name, unittest.equals('foo')); | 222 unittest.expect(o.name, unittest.equals('foo')); |
137 unittest.expect(o.selfLink, unittest.equals('foo')); | 223 unittest.expect(o.selfLink, unittest.equals('foo')); |
138 } | 224 } |
139 buildCounterManifest--; | 225 buildCounterManifest--; |
140 } | 226 } |
141 | 227 |
142 buildUnnamed1657() { | 228 buildUnnamed2357() { |
143 var o = new core.List<api.Manifest>(); | 229 var o = new core.List<api.Manifest>(); |
144 o.add(buildManifest()); | 230 o.add(buildManifest()); |
145 o.add(buildManifest()); | 231 o.add(buildManifest()); |
146 return o; | 232 return o; |
147 } | 233 } |
148 | 234 |
149 checkUnnamed1657(core.List<api.Manifest> o) { | 235 checkUnnamed2357(core.List<api.Manifest> o) { |
150 unittest.expect(o, unittest.hasLength(2)); | 236 unittest.expect(o, unittest.hasLength(2)); |
151 checkManifest(o[0]); | 237 checkManifest(o[0]); |
152 checkManifest(o[1]); | 238 checkManifest(o[1]); |
153 } | 239 } |
154 | 240 |
155 core.int buildCounterManifestsListResponse = 0; | 241 core.int buildCounterManifestsListResponse = 0; |
156 buildManifestsListResponse() { | 242 buildManifestsListResponse() { |
157 var o = new api.ManifestsListResponse(); | 243 var o = new api.ManifestsListResponse(); |
158 buildCounterManifestsListResponse++; | 244 buildCounterManifestsListResponse++; |
159 if (buildCounterManifestsListResponse < 3) { | 245 if (buildCounterManifestsListResponse < 3) { |
160 o.manifests = buildUnnamed1657(); | 246 o.manifests = buildUnnamed2357(); |
161 o.nextPageToken = "foo"; | 247 o.nextPageToken = "foo"; |
162 } | 248 } |
163 buildCounterManifestsListResponse--; | 249 buildCounterManifestsListResponse--; |
164 return o; | 250 return o; |
165 } | 251 } |
166 | 252 |
167 checkManifestsListResponse(api.ManifestsListResponse o) { | 253 checkManifestsListResponse(api.ManifestsListResponse o) { |
168 buildCounterManifestsListResponse++; | 254 buildCounterManifestsListResponse++; |
169 if (buildCounterManifestsListResponse < 3) { | 255 if (buildCounterManifestsListResponse < 3) { |
170 checkUnnamed1657(o.manifests); | 256 checkUnnamed2357(o.manifests); |
171 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 257 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
172 } | 258 } |
173 buildCounterManifestsListResponse--; | 259 buildCounterManifestsListResponse--; |
174 } | 260 } |
175 | 261 |
176 core.int buildCounterOperationErrorErrors = 0; | 262 core.int buildCounterOperationErrorErrors = 0; |
177 buildOperationErrorErrors() { | 263 buildOperationErrorErrors() { |
178 var o = new api.OperationErrorErrors(); | 264 var o = new api.OperationErrorErrors(); |
179 buildCounterOperationErrorErrors++; | 265 buildCounterOperationErrorErrors++; |
180 if (buildCounterOperationErrorErrors < 3) { | 266 if (buildCounterOperationErrorErrors < 3) { |
181 o.code = "foo"; | 267 o.code = "foo"; |
182 o.location = "foo"; | 268 o.location = "foo"; |
183 o.message = "foo"; | 269 o.message = "foo"; |
184 } | 270 } |
185 buildCounterOperationErrorErrors--; | 271 buildCounterOperationErrorErrors--; |
186 return o; | 272 return o; |
187 } | 273 } |
188 | 274 |
189 checkOperationErrorErrors(api.OperationErrorErrors o) { | 275 checkOperationErrorErrors(api.OperationErrorErrors o) { |
190 buildCounterOperationErrorErrors++; | 276 buildCounterOperationErrorErrors++; |
191 if (buildCounterOperationErrorErrors < 3) { | 277 if (buildCounterOperationErrorErrors < 3) { |
192 unittest.expect(o.code, unittest.equals('foo')); | 278 unittest.expect(o.code, unittest.equals('foo')); |
193 unittest.expect(o.location, unittest.equals('foo')); | 279 unittest.expect(o.location, unittest.equals('foo')); |
194 unittest.expect(o.message, unittest.equals('foo')); | 280 unittest.expect(o.message, unittest.equals('foo')); |
195 } | 281 } |
196 buildCounterOperationErrorErrors--; | 282 buildCounterOperationErrorErrors--; |
197 } | 283 } |
198 | 284 |
199 buildUnnamed1658() { | 285 buildUnnamed2358() { |
200 var o = new core.List<api.OperationErrorErrors>(); | 286 var o = new core.List<api.OperationErrorErrors>(); |
201 o.add(buildOperationErrorErrors()); | 287 o.add(buildOperationErrorErrors()); |
202 o.add(buildOperationErrorErrors()); | 288 o.add(buildOperationErrorErrors()); |
203 return o; | 289 return o; |
204 } | 290 } |
205 | 291 |
206 checkUnnamed1658(core.List<api.OperationErrorErrors> o) { | 292 checkUnnamed2358(core.List<api.OperationErrorErrors> o) { |
207 unittest.expect(o, unittest.hasLength(2)); | 293 unittest.expect(o, unittest.hasLength(2)); |
208 checkOperationErrorErrors(o[0]); | 294 checkOperationErrorErrors(o[0]); |
209 checkOperationErrorErrors(o[1]); | 295 checkOperationErrorErrors(o[1]); |
210 } | 296 } |
211 | 297 |
212 core.int buildCounterOperationError = 0; | 298 core.int buildCounterOperationError = 0; |
213 buildOperationError() { | 299 buildOperationError() { |
214 var o = new api.OperationError(); | 300 var o = new api.OperationError(); |
215 buildCounterOperationError++; | 301 buildCounterOperationError++; |
216 if (buildCounterOperationError < 3) { | 302 if (buildCounterOperationError < 3) { |
217 o.errors = buildUnnamed1658(); | 303 o.errors = buildUnnamed2358(); |
218 } | 304 } |
219 buildCounterOperationError--; | 305 buildCounterOperationError--; |
220 return o; | 306 return o; |
221 } | 307 } |
222 | 308 |
223 checkOperationError(api.OperationError o) { | 309 checkOperationError(api.OperationError o) { |
224 buildCounterOperationError++; | 310 buildCounterOperationError++; |
225 if (buildCounterOperationError < 3) { | 311 if (buildCounterOperationError < 3) { |
226 checkUnnamed1658(o.errors); | 312 checkUnnamed2358(o.errors); |
227 } | 313 } |
228 buildCounterOperationError--; | 314 buildCounterOperationError--; |
229 } | 315 } |
230 | 316 |
231 core.int buildCounterOperationWarningsData = 0; | 317 core.int buildCounterOperationWarningsData = 0; |
232 buildOperationWarningsData() { | 318 buildOperationWarningsData() { |
233 var o = new api.OperationWarningsData(); | 319 var o = new api.OperationWarningsData(); |
234 buildCounterOperationWarningsData++; | 320 buildCounterOperationWarningsData++; |
235 if (buildCounterOperationWarningsData < 3) { | 321 if (buildCounterOperationWarningsData < 3) { |
236 o.key = "foo"; | 322 o.key = "foo"; |
237 o.value = "foo"; | 323 o.value = "foo"; |
238 } | 324 } |
239 buildCounterOperationWarningsData--; | 325 buildCounterOperationWarningsData--; |
240 return o; | 326 return o; |
241 } | 327 } |
242 | 328 |
243 checkOperationWarningsData(api.OperationWarningsData o) { | 329 checkOperationWarningsData(api.OperationWarningsData o) { |
244 buildCounterOperationWarningsData++; | 330 buildCounterOperationWarningsData++; |
245 if (buildCounterOperationWarningsData < 3) { | 331 if (buildCounterOperationWarningsData < 3) { |
246 unittest.expect(o.key, unittest.equals('foo')); | 332 unittest.expect(o.key, unittest.equals('foo')); |
247 unittest.expect(o.value, unittest.equals('foo')); | 333 unittest.expect(o.value, unittest.equals('foo')); |
248 } | 334 } |
249 buildCounterOperationWarningsData--; | 335 buildCounterOperationWarningsData--; |
250 } | 336 } |
251 | 337 |
252 buildUnnamed1659() { | 338 buildUnnamed2359() { |
253 var o = new core.List<api.OperationWarningsData>(); | 339 var o = new core.List<api.OperationWarningsData>(); |
254 o.add(buildOperationWarningsData()); | 340 o.add(buildOperationWarningsData()); |
255 o.add(buildOperationWarningsData()); | 341 o.add(buildOperationWarningsData()); |
256 return o; | 342 return o; |
257 } | 343 } |
258 | 344 |
259 checkUnnamed1659(core.List<api.OperationWarningsData> o) { | 345 checkUnnamed2359(core.List<api.OperationWarningsData> o) { |
260 unittest.expect(o, unittest.hasLength(2)); | 346 unittest.expect(o, unittest.hasLength(2)); |
261 checkOperationWarningsData(o[0]); | 347 checkOperationWarningsData(o[0]); |
262 checkOperationWarningsData(o[1]); | 348 checkOperationWarningsData(o[1]); |
263 } | 349 } |
264 | 350 |
265 core.int buildCounterOperationWarnings = 0; | 351 core.int buildCounterOperationWarnings = 0; |
266 buildOperationWarnings() { | 352 buildOperationWarnings() { |
267 var o = new api.OperationWarnings(); | 353 var o = new api.OperationWarnings(); |
268 buildCounterOperationWarnings++; | 354 buildCounterOperationWarnings++; |
269 if (buildCounterOperationWarnings < 3) { | 355 if (buildCounterOperationWarnings < 3) { |
270 o.code = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 356 o.code = "foo"; |
271 o.data = buildUnnamed1659(); | 357 o.data = buildUnnamed2359(); |
272 o.message = "foo"; | 358 o.message = "foo"; |
273 } | 359 } |
274 buildCounterOperationWarnings--; | 360 buildCounterOperationWarnings--; |
275 return o; | 361 return o; |
276 } | 362 } |
277 | 363 |
278 checkOperationWarnings(api.OperationWarnings o) { | 364 checkOperationWarnings(api.OperationWarnings o) { |
279 buildCounterOperationWarnings++; | 365 buildCounterOperationWarnings++; |
280 if (buildCounterOperationWarnings < 3) { | 366 if (buildCounterOperationWarnings < 3) { |
281 var casted1 = (o.code) as core.Map; unittest.expect(casted1, unittest.hasLen
gth(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.
expect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"
], unittest.equals('foo')); | 367 unittest.expect(o.code, unittest.equals('foo')); |
282 checkUnnamed1659(o.data); | 368 checkUnnamed2359(o.data); |
283 unittest.expect(o.message, unittest.equals('foo')); | 369 unittest.expect(o.message, unittest.equals('foo')); |
284 } | 370 } |
285 buildCounterOperationWarnings--; | 371 buildCounterOperationWarnings--; |
286 } | 372 } |
287 | 373 |
288 buildUnnamed1660() { | 374 buildUnnamed2360() { |
289 var o = new core.List<api.OperationWarnings>(); | 375 var o = new core.List<api.OperationWarnings>(); |
290 o.add(buildOperationWarnings()); | 376 o.add(buildOperationWarnings()); |
291 o.add(buildOperationWarnings()); | 377 o.add(buildOperationWarnings()); |
292 return o; | 378 return o; |
293 } | 379 } |
294 | 380 |
295 checkUnnamed1660(core.List<api.OperationWarnings> o) { | 381 checkUnnamed2360(core.List<api.OperationWarnings> o) { |
296 unittest.expect(o, unittest.hasLength(2)); | 382 unittest.expect(o, unittest.hasLength(2)); |
297 checkOperationWarnings(o[0]); | 383 checkOperationWarnings(o[0]); |
298 checkOperationWarnings(o[1]); | 384 checkOperationWarnings(o[1]); |
299 } | 385 } |
300 | 386 |
301 core.int buildCounterOperation = 0; | 387 core.int buildCounterOperation = 0; |
302 buildOperation() { | 388 buildOperation() { |
303 var o = new api.Operation(); | 389 var o = new api.Operation(); |
304 buildCounterOperation++; | 390 buildCounterOperation++; |
305 if (buildCounterOperation < 3) { | 391 if (buildCounterOperation < 3) { |
| 392 o.clientOperationId = "foo"; |
306 o.creationTimestamp = "foo"; | 393 o.creationTimestamp = "foo"; |
307 o.endTime = "foo"; | 394 o.endTime = "foo"; |
308 o.error = buildOperationError(); | 395 o.error = buildOperationError(); |
309 o.httpErrorMessage = "foo"; | 396 o.httpErrorMessage = "foo"; |
310 o.httpErrorStatusCode = 42; | 397 o.httpErrorStatusCode = 42; |
311 o.id = "foo"; | 398 o.id = "foo"; |
312 o.insertTime = "foo"; | 399 o.insertTime = "foo"; |
| 400 o.kind = "foo"; |
313 o.name = "foo"; | 401 o.name = "foo"; |
314 o.operationType = "foo"; | 402 o.operationType = "foo"; |
315 o.progress = 42; | 403 o.progress = 42; |
| 404 o.region = "foo"; |
316 o.selfLink = "foo"; | 405 o.selfLink = "foo"; |
317 o.startTime = "foo"; | 406 o.startTime = "foo"; |
318 o.status = "foo"; | 407 o.status = "foo"; |
319 o.statusMessage = "foo"; | 408 o.statusMessage = "foo"; |
320 o.targetId = "foo"; | 409 o.targetId = "foo"; |
321 o.targetLink = "foo"; | 410 o.targetLink = "foo"; |
322 o.user = "foo"; | 411 o.user = "foo"; |
323 o.warnings = buildUnnamed1660(); | 412 o.warnings = buildUnnamed2360(); |
| 413 o.zone = "foo"; |
324 } | 414 } |
325 buildCounterOperation--; | 415 buildCounterOperation--; |
326 return o; | 416 return o; |
327 } | 417 } |
328 | 418 |
329 checkOperation(api.Operation o) { | 419 checkOperation(api.Operation o) { |
330 buildCounterOperation++; | 420 buildCounterOperation++; |
331 if (buildCounterOperation < 3) { | 421 if (buildCounterOperation < 3) { |
| 422 unittest.expect(o.clientOperationId, unittest.equals('foo')); |
332 unittest.expect(o.creationTimestamp, unittest.equals('foo')); | 423 unittest.expect(o.creationTimestamp, unittest.equals('foo')); |
333 unittest.expect(o.endTime, unittest.equals('foo')); | 424 unittest.expect(o.endTime, unittest.equals('foo')); |
334 checkOperationError(o.error); | 425 checkOperationError(o.error); |
335 unittest.expect(o.httpErrorMessage, unittest.equals('foo')); | 426 unittest.expect(o.httpErrorMessage, unittest.equals('foo')); |
336 unittest.expect(o.httpErrorStatusCode, unittest.equals(42)); | 427 unittest.expect(o.httpErrorStatusCode, unittest.equals(42)); |
337 unittest.expect(o.id, unittest.equals('foo')); | 428 unittest.expect(o.id, unittest.equals('foo')); |
338 unittest.expect(o.insertTime, unittest.equals('foo')); | 429 unittest.expect(o.insertTime, unittest.equals('foo')); |
| 430 unittest.expect(o.kind, unittest.equals('foo')); |
339 unittest.expect(o.name, unittest.equals('foo')); | 431 unittest.expect(o.name, unittest.equals('foo')); |
340 unittest.expect(o.operationType, unittest.equals('foo')); | 432 unittest.expect(o.operationType, unittest.equals('foo')); |
341 unittest.expect(o.progress, unittest.equals(42)); | 433 unittest.expect(o.progress, unittest.equals(42)); |
| 434 unittest.expect(o.region, unittest.equals('foo')); |
342 unittest.expect(o.selfLink, unittest.equals('foo')); | 435 unittest.expect(o.selfLink, unittest.equals('foo')); |
343 unittest.expect(o.startTime, unittest.equals('foo')); | 436 unittest.expect(o.startTime, unittest.equals('foo')); |
344 unittest.expect(o.status, unittest.equals('foo')); | 437 unittest.expect(o.status, unittest.equals('foo')); |
345 unittest.expect(o.statusMessage, unittest.equals('foo')); | 438 unittest.expect(o.statusMessage, unittest.equals('foo')); |
346 unittest.expect(o.targetId, unittest.equals('foo')); | 439 unittest.expect(o.targetId, unittest.equals('foo')); |
347 unittest.expect(o.targetLink, unittest.equals('foo')); | 440 unittest.expect(o.targetLink, unittest.equals('foo')); |
348 unittest.expect(o.user, unittest.equals('foo')); | 441 unittest.expect(o.user, unittest.equals('foo')); |
349 checkUnnamed1660(o.warnings); | 442 checkUnnamed2360(o.warnings); |
| 443 unittest.expect(o.zone, unittest.equals('foo')); |
350 } | 444 } |
351 buildCounterOperation--; | 445 buildCounterOperation--; |
352 } | 446 } |
353 | 447 |
354 buildUnnamed1661() { | 448 buildUnnamed2361() { |
355 var o = new core.List<api.Operation>(); | 449 var o = new core.List<api.Operation>(); |
356 o.add(buildOperation()); | 450 o.add(buildOperation()); |
357 o.add(buildOperation()); | 451 o.add(buildOperation()); |
358 return o; | 452 return o; |
359 } | 453 } |
360 | 454 |
361 checkUnnamed1661(core.List<api.Operation> o) { | 455 checkUnnamed2361(core.List<api.Operation> o) { |
362 unittest.expect(o, unittest.hasLength(2)); | 456 unittest.expect(o, unittest.hasLength(2)); |
363 checkOperation(o[0]); | 457 checkOperation(o[0]); |
364 checkOperation(o[1]); | 458 checkOperation(o[1]); |
365 } | 459 } |
366 | 460 |
367 core.int buildCounterOperationsListResponse = 0; | 461 core.int buildCounterOperationsListResponse = 0; |
368 buildOperationsListResponse() { | 462 buildOperationsListResponse() { |
369 var o = new api.OperationsListResponse(); | 463 var o = new api.OperationsListResponse(); |
370 buildCounterOperationsListResponse++; | 464 buildCounterOperationsListResponse++; |
371 if (buildCounterOperationsListResponse < 3) { | 465 if (buildCounterOperationsListResponse < 3) { |
372 o.nextPageToken = "foo"; | 466 o.nextPageToken = "foo"; |
373 o.operations = buildUnnamed1661(); | 467 o.operations = buildUnnamed2361(); |
374 } | 468 } |
375 buildCounterOperationsListResponse--; | 469 buildCounterOperationsListResponse--; |
376 return o; | 470 return o; |
377 } | 471 } |
378 | 472 |
379 checkOperationsListResponse(api.OperationsListResponse o) { | 473 checkOperationsListResponse(api.OperationsListResponse o) { |
380 buildCounterOperationsListResponse++; | 474 buildCounterOperationsListResponse++; |
381 if (buildCounterOperationsListResponse < 3) { | 475 if (buildCounterOperationsListResponse < 3) { |
382 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 476 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
383 checkUnnamed1661(o.operations); | 477 checkUnnamed2361(o.operations); |
384 } | 478 } |
385 buildCounterOperationsListResponse--; | 479 buildCounterOperationsListResponse--; |
386 } | 480 } |
387 | 481 |
388 buildUnnamed1662() { | |
389 var o = new core.List<core.String>(); | |
390 o.add("foo"); | |
391 o.add("foo"); | |
392 return o; | |
393 } | |
394 | |
395 checkUnnamed1662(core.List<core.String> o) { | |
396 unittest.expect(o, unittest.hasLength(2)); | |
397 unittest.expect(o[0], unittest.equals('foo')); | |
398 unittest.expect(o[1], unittest.equals('foo')); | |
399 } | |
400 | |
401 core.int buildCounterResource = 0; | 482 core.int buildCounterResource = 0; |
402 buildResource() { | 483 buildResource() { |
403 var o = new api.Resource(); | 484 var o = new api.Resource(); |
404 buildCounterResource++; | 485 buildCounterResource++; |
405 if (buildCounterResource < 3) { | 486 if (buildCounterResource < 3) { |
406 o.errors = buildUnnamed1662(); | 487 o.finalProperties = "foo"; |
407 o.id = "foo"; | 488 o.id = "foo"; |
408 o.intent = "foo"; | 489 o.insertTime = "foo"; |
409 o.manifest = "foo"; | 490 o.manifest = "foo"; |
410 o.name = "foo"; | 491 o.name = "foo"; |
411 o.state = "foo"; | 492 o.properties = "foo"; |
412 o.type = "foo"; | 493 o.type = "foo"; |
| 494 o.update = buildResourceUpdate(); |
| 495 o.updateTime = "foo"; |
413 o.url = "foo"; | 496 o.url = "foo"; |
414 } | 497 } |
415 buildCounterResource--; | 498 buildCounterResource--; |
416 return o; | 499 return o; |
417 } | 500 } |
418 | 501 |
419 checkResource(api.Resource o) { | 502 checkResource(api.Resource o) { |
420 buildCounterResource++; | 503 buildCounterResource++; |
421 if (buildCounterResource < 3) { | 504 if (buildCounterResource < 3) { |
422 checkUnnamed1662(o.errors); | 505 unittest.expect(o.finalProperties, unittest.equals('foo')); |
423 unittest.expect(o.id, unittest.equals('foo')); | 506 unittest.expect(o.id, unittest.equals('foo')); |
424 unittest.expect(o.intent, unittest.equals('foo')); | 507 unittest.expect(o.insertTime, unittest.equals('foo')); |
425 unittest.expect(o.manifest, unittest.equals('foo')); | 508 unittest.expect(o.manifest, unittest.equals('foo')); |
426 unittest.expect(o.name, unittest.equals('foo')); | 509 unittest.expect(o.name, unittest.equals('foo')); |
427 unittest.expect(o.state, unittest.equals('foo')); | 510 unittest.expect(o.properties, unittest.equals('foo')); |
428 unittest.expect(o.type, unittest.equals('foo')); | 511 unittest.expect(o.type, unittest.equals('foo')); |
| 512 checkResourceUpdate(o.update); |
| 513 unittest.expect(o.updateTime, unittest.equals('foo')); |
429 unittest.expect(o.url, unittest.equals('foo')); | 514 unittest.expect(o.url, unittest.equals('foo')); |
430 } | 515 } |
431 buildCounterResource--; | 516 buildCounterResource--; |
432 } | 517 } |
433 | 518 |
434 buildUnnamed1663() { | 519 buildUnnamed2362() { |
| 520 var o = new core.List<core.String>(); |
| 521 o.add("foo"); |
| 522 o.add("foo"); |
| 523 return o; |
| 524 } |
| 525 |
| 526 checkUnnamed2362(core.List<core.String> o) { |
| 527 unittest.expect(o, unittest.hasLength(2)); |
| 528 unittest.expect(o[0], unittest.equals('foo')); |
| 529 unittest.expect(o[1], unittest.equals('foo')); |
| 530 } |
| 531 |
| 532 core.int buildCounterResourceUpdate = 0; |
| 533 buildResourceUpdate() { |
| 534 var o = new api.ResourceUpdate(); |
| 535 buildCounterResourceUpdate++; |
| 536 if (buildCounterResourceUpdate < 3) { |
| 537 o.errors = buildUnnamed2362(); |
| 538 o.finalProperties = "foo"; |
| 539 o.intent = "foo"; |
| 540 o.manifest = "foo"; |
| 541 o.properties = "foo"; |
| 542 o.state = "foo"; |
| 543 } |
| 544 buildCounterResourceUpdate--; |
| 545 return o; |
| 546 } |
| 547 |
| 548 checkResourceUpdate(api.ResourceUpdate o) { |
| 549 buildCounterResourceUpdate++; |
| 550 if (buildCounterResourceUpdate < 3) { |
| 551 checkUnnamed2362(o.errors); |
| 552 unittest.expect(o.finalProperties, unittest.equals('foo')); |
| 553 unittest.expect(o.intent, unittest.equals('foo')); |
| 554 unittest.expect(o.manifest, unittest.equals('foo')); |
| 555 unittest.expect(o.properties, unittest.equals('foo')); |
| 556 unittest.expect(o.state, unittest.equals('foo')); |
| 557 } |
| 558 buildCounterResourceUpdate--; |
| 559 } |
| 560 |
| 561 buildUnnamed2363() { |
435 var o = new core.List<api.Resource>(); | 562 var o = new core.List<api.Resource>(); |
436 o.add(buildResource()); | 563 o.add(buildResource()); |
437 o.add(buildResource()); | 564 o.add(buildResource()); |
438 return o; | 565 return o; |
439 } | 566 } |
440 | 567 |
441 checkUnnamed1663(core.List<api.Resource> o) { | 568 checkUnnamed2363(core.List<api.Resource> o) { |
442 unittest.expect(o, unittest.hasLength(2)); | 569 unittest.expect(o, unittest.hasLength(2)); |
443 checkResource(o[0]); | 570 checkResource(o[0]); |
444 checkResource(o[1]); | 571 checkResource(o[1]); |
445 } | 572 } |
446 | 573 |
447 core.int buildCounterResourcesListResponse = 0; | 574 core.int buildCounterResourcesListResponse = 0; |
448 buildResourcesListResponse() { | 575 buildResourcesListResponse() { |
449 var o = new api.ResourcesListResponse(); | 576 var o = new api.ResourcesListResponse(); |
450 buildCounterResourcesListResponse++; | 577 buildCounterResourcesListResponse++; |
451 if (buildCounterResourcesListResponse < 3) { | 578 if (buildCounterResourcesListResponse < 3) { |
452 o.nextPageToken = "foo"; | 579 o.nextPageToken = "foo"; |
453 o.resources = buildUnnamed1663(); | 580 o.resources = buildUnnamed2363(); |
454 } | 581 } |
455 buildCounterResourcesListResponse--; | 582 buildCounterResourcesListResponse--; |
456 return o; | 583 return o; |
457 } | 584 } |
458 | 585 |
459 checkResourcesListResponse(api.ResourcesListResponse o) { | 586 checkResourcesListResponse(api.ResourcesListResponse o) { |
460 buildCounterResourcesListResponse++; | 587 buildCounterResourcesListResponse++; |
461 if (buildCounterResourcesListResponse < 3) { | 588 if (buildCounterResourcesListResponse < 3) { |
462 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 589 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
463 checkUnnamed1663(o.resources); | 590 checkUnnamed2363(o.resources); |
464 } | 591 } |
465 buildCounterResourcesListResponse--; | 592 buildCounterResourcesListResponse--; |
466 } | 593 } |
467 | 594 |
| 595 buildUnnamed2364() { |
| 596 var o = new core.List<api.ImportFile>(); |
| 597 o.add(buildImportFile()); |
| 598 o.add(buildImportFile()); |
| 599 return o; |
| 600 } |
| 601 |
| 602 checkUnnamed2364(core.List<api.ImportFile> o) { |
| 603 unittest.expect(o, unittest.hasLength(2)); |
| 604 checkImportFile(o[0]); |
| 605 checkImportFile(o[1]); |
| 606 } |
| 607 |
| 608 core.int buildCounterTargetConfiguration = 0; |
| 609 buildTargetConfiguration() { |
| 610 var o = new api.TargetConfiguration(); |
| 611 buildCounterTargetConfiguration++; |
| 612 if (buildCounterTargetConfiguration < 3) { |
| 613 o.config = "foo"; |
| 614 o.imports = buildUnnamed2364(); |
| 615 } |
| 616 buildCounterTargetConfiguration--; |
| 617 return o; |
| 618 } |
| 619 |
| 620 checkTargetConfiguration(api.TargetConfiguration o) { |
| 621 buildCounterTargetConfiguration++; |
| 622 if (buildCounterTargetConfiguration < 3) { |
| 623 unittest.expect(o.config, unittest.equals('foo')); |
| 624 checkUnnamed2364(o.imports); |
| 625 } |
| 626 buildCounterTargetConfiguration--; |
| 627 } |
| 628 |
468 core.int buildCounterType = 0; | 629 core.int buildCounterType = 0; |
469 buildType() { | 630 buildType() { |
470 var o = new api.Type(); | 631 var o = new api.Type(); |
471 buildCounterType++; | 632 buildCounterType++; |
472 if (buildCounterType < 3) { | 633 if (buildCounterType < 3) { |
473 o.name = "foo"; | 634 o.name = "foo"; |
474 } | 635 } |
475 buildCounterType--; | 636 buildCounterType--; |
476 return o; | 637 return o; |
477 } | 638 } |
478 | 639 |
479 checkType(api.Type o) { | 640 checkType(api.Type o) { |
480 buildCounterType++; | 641 buildCounterType++; |
481 if (buildCounterType < 3) { | 642 if (buildCounterType < 3) { |
482 unittest.expect(o.name, unittest.equals('foo')); | 643 unittest.expect(o.name, unittest.equals('foo')); |
483 } | 644 } |
484 buildCounterType--; | 645 buildCounterType--; |
485 } | 646 } |
486 | 647 |
487 buildUnnamed1664() { | 648 buildUnnamed2365() { |
488 var o = new core.List<api.Type>(); | 649 var o = new core.List<api.Type>(); |
489 o.add(buildType()); | 650 o.add(buildType()); |
490 o.add(buildType()); | 651 o.add(buildType()); |
491 return o; | 652 return o; |
492 } | 653 } |
493 | 654 |
494 checkUnnamed1664(core.List<api.Type> o) { | 655 checkUnnamed2365(core.List<api.Type> o) { |
495 unittest.expect(o, unittest.hasLength(2)); | 656 unittest.expect(o, unittest.hasLength(2)); |
496 checkType(o[0]); | 657 checkType(o[0]); |
497 checkType(o[1]); | 658 checkType(o[1]); |
498 } | 659 } |
499 | 660 |
500 core.int buildCounterTypesListResponse = 0; | 661 core.int buildCounterTypesListResponse = 0; |
501 buildTypesListResponse() { | 662 buildTypesListResponse() { |
502 var o = new api.TypesListResponse(); | 663 var o = new api.TypesListResponse(); |
503 buildCounterTypesListResponse++; | 664 buildCounterTypesListResponse++; |
504 if (buildCounterTypesListResponse < 3) { | 665 if (buildCounterTypesListResponse < 3) { |
505 o.types = buildUnnamed1664(); | 666 o.nextPageToken = "foo"; |
| 667 o.types = buildUnnamed2365(); |
506 } | 668 } |
507 buildCounterTypesListResponse--; | 669 buildCounterTypesListResponse--; |
508 return o; | 670 return o; |
509 } | 671 } |
510 | 672 |
511 checkTypesListResponse(api.TypesListResponse o) { | 673 checkTypesListResponse(api.TypesListResponse o) { |
512 buildCounterTypesListResponse++; | 674 buildCounterTypesListResponse++; |
513 if (buildCounterTypesListResponse < 3) { | 675 if (buildCounterTypesListResponse < 3) { |
514 checkUnnamed1664(o.types); | 676 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 677 checkUnnamed2365(o.types); |
515 } | 678 } |
516 buildCounterTypesListResponse--; | 679 buildCounterTypesListResponse--; |
517 } | 680 } |
518 | 681 |
519 | 682 |
520 main() { | 683 main() { |
521 unittest.group("obj-schema-Deployment", () { | 684 unittest.group("obj-schema-Deployment", () { |
522 unittest.test("to-json--from-json", () { | 685 unittest.test("to-json--from-json", () { |
523 var o = buildDeployment(); | 686 var o = buildDeployment(); |
524 var od = new api.Deployment.fromJson(o.toJson()); | 687 var od = new api.Deployment.fromJson(o.toJson()); |
525 checkDeployment(od); | 688 checkDeployment(od); |
526 }); | 689 }); |
527 }); | 690 }); |
528 | 691 |
529 | 692 |
| 693 unittest.group("obj-schema-DeploymentUpdate", () { |
| 694 unittest.test("to-json--from-json", () { |
| 695 var o = buildDeploymentUpdate(); |
| 696 var od = new api.DeploymentUpdate.fromJson(o.toJson()); |
| 697 checkDeploymentUpdate(od); |
| 698 }); |
| 699 }); |
| 700 |
| 701 |
530 unittest.group("obj-schema-DeploymentsListResponse", () { | 702 unittest.group("obj-schema-DeploymentsListResponse", () { |
531 unittest.test("to-json--from-json", () { | 703 unittest.test("to-json--from-json", () { |
532 var o = buildDeploymentsListResponse(); | 704 var o = buildDeploymentsListResponse(); |
533 var od = new api.DeploymentsListResponse.fromJson(o.toJson()); | 705 var od = new api.DeploymentsListResponse.fromJson(o.toJson()); |
534 checkDeploymentsListResponse(od); | 706 checkDeploymentsListResponse(od); |
535 }); | 707 }); |
536 }); | 708 }); |
537 | 709 |
538 | 710 |
| 711 unittest.group("obj-schema-ImportFile", () { |
| 712 unittest.test("to-json--from-json", () { |
| 713 var o = buildImportFile(); |
| 714 var od = new api.ImportFile.fromJson(o.toJson()); |
| 715 checkImportFile(od); |
| 716 }); |
| 717 }); |
| 718 |
| 719 |
539 unittest.group("obj-schema-Manifest", () { | 720 unittest.group("obj-schema-Manifest", () { |
540 unittest.test("to-json--from-json", () { | 721 unittest.test("to-json--from-json", () { |
541 var o = buildManifest(); | 722 var o = buildManifest(); |
542 var od = new api.Manifest.fromJson(o.toJson()); | 723 var od = new api.Manifest.fromJson(o.toJson()); |
543 checkManifest(od); | 724 checkManifest(od); |
544 }); | 725 }); |
545 }); | 726 }); |
546 | 727 |
547 | 728 |
548 unittest.group("obj-schema-ManifestsListResponse", () { | 729 unittest.group("obj-schema-ManifestsListResponse", () { |
(...skipping 61 matching lines...) Loading... |
610 | 791 |
611 unittest.group("obj-schema-Resource", () { | 792 unittest.group("obj-schema-Resource", () { |
612 unittest.test("to-json--from-json", () { | 793 unittest.test("to-json--from-json", () { |
613 var o = buildResource(); | 794 var o = buildResource(); |
614 var od = new api.Resource.fromJson(o.toJson()); | 795 var od = new api.Resource.fromJson(o.toJson()); |
615 checkResource(od); | 796 checkResource(od); |
616 }); | 797 }); |
617 }); | 798 }); |
618 | 799 |
619 | 800 |
| 801 unittest.group("obj-schema-ResourceUpdate", () { |
| 802 unittest.test("to-json--from-json", () { |
| 803 var o = buildResourceUpdate(); |
| 804 var od = new api.ResourceUpdate.fromJson(o.toJson()); |
| 805 checkResourceUpdate(od); |
| 806 }); |
| 807 }); |
| 808 |
| 809 |
620 unittest.group("obj-schema-ResourcesListResponse", () { | 810 unittest.group("obj-schema-ResourcesListResponse", () { |
621 unittest.test("to-json--from-json", () { | 811 unittest.test("to-json--from-json", () { |
622 var o = buildResourcesListResponse(); | 812 var o = buildResourcesListResponse(); |
623 var od = new api.ResourcesListResponse.fromJson(o.toJson()); | 813 var od = new api.ResourcesListResponse.fromJson(o.toJson()); |
624 checkResourcesListResponse(od); | 814 checkResourcesListResponse(od); |
625 }); | 815 }); |
626 }); | 816 }); |
627 | 817 |
628 | 818 |
| 819 unittest.group("obj-schema-TargetConfiguration", () { |
| 820 unittest.test("to-json--from-json", () { |
| 821 var o = buildTargetConfiguration(); |
| 822 var od = new api.TargetConfiguration.fromJson(o.toJson()); |
| 823 checkTargetConfiguration(od); |
| 824 }); |
| 825 }); |
| 826 |
| 827 |
629 unittest.group("obj-schema-Type", () { | 828 unittest.group("obj-schema-Type", () { |
630 unittest.test("to-json--from-json", () { | 829 unittest.test("to-json--from-json", () { |
631 var o = buildType(); | 830 var o = buildType(); |
632 var od = new api.Type.fromJson(o.toJson()); | 831 var od = new api.Type.fromJson(o.toJson()); |
633 checkType(od); | 832 checkType(od); |
634 }); | 833 }); |
635 }); | 834 }); |
636 | 835 |
637 | 836 |
638 unittest.group("obj-schema-TypesListResponse", () { | 837 unittest.group("obj-schema-TypesListResponse", () { |
(...skipping 136 matching lines...) Loading... |
775 res.insert(arg_request, arg_project).then(unittest.expectAsync(((api.Opera
tion response) { | 974 res.insert(arg_request, arg_project).then(unittest.expectAsync(((api.Opera
tion response) { |
776 checkOperation(response); | 975 checkOperation(response); |
777 }))); | 976 }))); |
778 }); | 977 }); |
779 | 978 |
780 unittest.test("method--list", () { | 979 unittest.test("method--list", () { |
781 | 980 |
782 var mock = new HttpServerMock(); | 981 var mock = new HttpServerMock(); |
783 api.DeploymentsResourceApi res = new api.DeploymentmanagerApi(mock).deploy
ments; | 982 api.DeploymentsResourceApi res = new api.DeploymentmanagerApi(mock).deploy
ments; |
784 var arg_project = "foo"; | 983 var arg_project = "foo"; |
| 984 var arg_filter = "foo"; |
785 var arg_maxResults = 42; | 985 var arg_maxResults = 42; |
786 var arg_pageToken = "foo"; | 986 var arg_pageToken = "foo"; |
787 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 987 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
788 var path = (req.url).path; | 988 var path = (req.url).path; |
789 var pathOffset = 0; | 989 var pathOffset = 0; |
790 var index; | 990 var index; |
791 var subPart; | 991 var subPart; |
792 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 992 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
793 pathOffset += 1; | 993 pathOffset += 1; |
794 | 994 |
795 var query = (req.url).query; | 995 var query = (req.url).query; |
796 var queryOffset = 0; | 996 var queryOffset = 0; |
797 var queryMap = {}; | 997 var queryMap = {}; |
798 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 998 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
799 parseBool(n) { | 999 parseBool(n) { |
800 if (n == "true") return true; | 1000 if (n == "true") return true; |
801 if (n == "false") return false; | 1001 if (n == "false") return false; |
802 if (n == null) return null; | 1002 if (n == null) return null; |
803 throw new core.ArgumentError("Invalid boolean: $n"); | 1003 throw new core.ArgumentError("Invalid boolean: $n"); |
804 } | 1004 } |
805 if (query.length > 0) { | 1005 if (query.length > 0) { |
806 for (var part in query.split("&")) { | 1006 for (var part in query.split("&")) { |
807 var keyvalue = part.split("="); | 1007 var keyvalue = part.split("="); |
808 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1008 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
809 } | 1009 } |
810 } | 1010 } |
| 1011 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
811 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1012 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
812 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1013 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
813 | 1014 |
814 | 1015 |
815 var h = { | 1016 var h = { |
816 "content-type" : "application/json; charset=utf-8", | 1017 "content-type" : "application/json; charset=utf-8", |
817 }; | 1018 }; |
818 var resp = convert.JSON.encode(buildDeploymentsListResponse()); | 1019 var resp = convert.JSON.encode(buildDeploymentsListResponse()); |
819 return new async.Future.value(stringResponse(200, h, resp)); | 1020 return new async.Future.value(stringResponse(200, h, resp)); |
820 }), true); | 1021 }), true); |
821 res.list(arg_project, maxResults: arg_maxResults, pageToken: arg_pageToken
).then(unittest.expectAsync(((api.DeploymentsListResponse response) { | 1022 res.list(arg_project, filter: arg_filter, maxResults: arg_maxResults, page
Token: arg_pageToken).then(unittest.expectAsync(((api.DeploymentsListResponse re
sponse) { |
822 checkDeploymentsListResponse(response); | 1023 checkDeploymentsListResponse(response); |
823 }))); | 1024 }))); |
824 }); | 1025 }); |
825 | 1026 |
| 1027 unittest.test("method--patch", () { |
| 1028 |
| 1029 var mock = new HttpServerMock(); |
| 1030 api.DeploymentsResourceApi res = new api.DeploymentmanagerApi(mock).deploy
ments; |
| 1031 var arg_request = buildDeployment(); |
| 1032 var arg_project = "foo"; |
| 1033 var arg_deployment = "foo"; |
| 1034 var arg_createPolicy = "foo"; |
| 1035 var arg_deletePolicy = "foo"; |
| 1036 var arg_updatePolicy = "foo"; |
| 1037 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1038 var obj = new api.Deployment.fromJson(json); |
| 1039 checkDeployment(obj); |
| 1040 |
| 1041 var path = (req.url).path; |
| 1042 var pathOffset = 0; |
| 1043 var index; |
| 1044 var subPart; |
| 1045 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1046 pathOffset += 1; |
| 1047 |
| 1048 var query = (req.url).query; |
| 1049 var queryOffset = 0; |
| 1050 var queryMap = {}; |
| 1051 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1052 parseBool(n) { |
| 1053 if (n == "true") return true; |
| 1054 if (n == "false") return false; |
| 1055 if (n == null) return null; |
| 1056 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1057 } |
| 1058 if (query.length > 0) { |
| 1059 for (var part in query.split("&")) { |
| 1060 var keyvalue = part.split("="); |
| 1061 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1062 } |
| 1063 } |
| 1064 unittest.expect(queryMap["createPolicy"].first, unittest.equals(arg_crea
tePolicy)); |
| 1065 unittest.expect(queryMap["deletePolicy"].first, unittest.equals(arg_dele
tePolicy)); |
| 1066 unittest.expect(queryMap["updatePolicy"].first, unittest.equals(arg_upda
tePolicy)); |
| 1067 |
| 1068 |
| 1069 var h = { |
| 1070 "content-type" : "application/json; charset=utf-8", |
| 1071 }; |
| 1072 var resp = convert.JSON.encode(buildOperation()); |
| 1073 return new async.Future.value(stringResponse(200, h, resp)); |
| 1074 }), true); |
| 1075 res.patch(arg_request, arg_project, arg_deployment, createPolicy: arg_crea
tePolicy, deletePolicy: arg_deletePolicy, updatePolicy: arg_updatePolicy).then(u
nittest.expectAsync(((api.Operation response) { |
| 1076 checkOperation(response); |
| 1077 }))); |
| 1078 }); |
| 1079 |
| 1080 unittest.test("method--update", () { |
| 1081 |
| 1082 var mock = new HttpServerMock(); |
| 1083 api.DeploymentsResourceApi res = new api.DeploymentmanagerApi(mock).deploy
ments; |
| 1084 var arg_request = buildDeployment(); |
| 1085 var arg_project = "foo"; |
| 1086 var arg_deployment = "foo"; |
| 1087 var arg_createPolicy = "foo"; |
| 1088 var arg_deletePolicy = "foo"; |
| 1089 var arg_updatePolicy = "foo"; |
| 1090 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1091 var obj = new api.Deployment.fromJson(json); |
| 1092 checkDeployment(obj); |
| 1093 |
| 1094 var path = (req.url).path; |
| 1095 var pathOffset = 0; |
| 1096 var index; |
| 1097 var subPart; |
| 1098 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1099 pathOffset += 1; |
| 1100 |
| 1101 var query = (req.url).query; |
| 1102 var queryOffset = 0; |
| 1103 var queryMap = {}; |
| 1104 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1105 parseBool(n) { |
| 1106 if (n == "true") return true; |
| 1107 if (n == "false") return false; |
| 1108 if (n == null) return null; |
| 1109 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1110 } |
| 1111 if (query.length > 0) { |
| 1112 for (var part in query.split("&")) { |
| 1113 var keyvalue = part.split("="); |
| 1114 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1115 } |
| 1116 } |
| 1117 unittest.expect(queryMap["createPolicy"].first, unittest.equals(arg_crea
tePolicy)); |
| 1118 unittest.expect(queryMap["deletePolicy"].first, unittest.equals(arg_dele
tePolicy)); |
| 1119 unittest.expect(queryMap["updatePolicy"].first, unittest.equals(arg_upda
tePolicy)); |
| 1120 |
| 1121 |
| 1122 var h = { |
| 1123 "content-type" : "application/json; charset=utf-8", |
| 1124 }; |
| 1125 var resp = convert.JSON.encode(buildOperation()); |
| 1126 return new async.Future.value(stringResponse(200, h, resp)); |
| 1127 }), true); |
| 1128 res.update(arg_request, arg_project, arg_deployment, createPolicy: arg_cre
atePolicy, deletePolicy: arg_deletePolicy, updatePolicy: arg_updatePolicy).then(
unittest.expectAsync(((api.Operation response) { |
| 1129 checkOperation(response); |
| 1130 }))); |
| 1131 }); |
| 1132 |
826 }); | 1133 }); |
827 | 1134 |
828 | 1135 |
829 unittest.group("resource-ManifestsResourceApi", () { | 1136 unittest.group("resource-ManifestsResourceApi", () { |
830 unittest.test("method--get", () { | 1137 unittest.test("method--get", () { |
831 | 1138 |
832 var mock = new HttpServerMock(); | 1139 var mock = new HttpServerMock(); |
833 api.ManifestsResourceApi res = new api.DeploymentmanagerApi(mock).manifest
s; | 1140 api.ManifestsResourceApi res = new api.DeploymentmanagerApi(mock).manifest
s; |
834 var arg_project = "foo"; | 1141 var arg_project = "foo"; |
835 var arg_deployment = "foo"; | 1142 var arg_deployment = "foo"; |
(...skipping 34 matching lines...) Loading... |
870 checkManifest(response); | 1177 checkManifest(response); |
871 }))); | 1178 }))); |
872 }); | 1179 }); |
873 | 1180 |
874 unittest.test("method--list", () { | 1181 unittest.test("method--list", () { |
875 | 1182 |
876 var mock = new HttpServerMock(); | 1183 var mock = new HttpServerMock(); |
877 api.ManifestsResourceApi res = new api.DeploymentmanagerApi(mock).manifest
s; | 1184 api.ManifestsResourceApi res = new api.DeploymentmanagerApi(mock).manifest
s; |
878 var arg_project = "foo"; | 1185 var arg_project = "foo"; |
879 var arg_deployment = "foo"; | 1186 var arg_deployment = "foo"; |
| 1187 var arg_filter = "foo"; |
880 var arg_maxResults = 42; | 1188 var arg_maxResults = 42; |
881 var arg_pageToken = "foo"; | 1189 var arg_pageToken = "foo"; |
882 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1190 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
883 var path = (req.url).path; | 1191 var path = (req.url).path; |
884 var pathOffset = 0; | 1192 var pathOffset = 0; |
885 var index; | 1193 var index; |
886 var subPart; | 1194 var subPart; |
887 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1195 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
888 pathOffset += 1; | 1196 pathOffset += 1; |
889 | 1197 |
890 var query = (req.url).query; | 1198 var query = (req.url).query; |
891 var queryOffset = 0; | 1199 var queryOffset = 0; |
892 var queryMap = {}; | 1200 var queryMap = {}; |
893 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1201 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
894 parseBool(n) { | 1202 parseBool(n) { |
895 if (n == "true") return true; | 1203 if (n == "true") return true; |
896 if (n == "false") return false; | 1204 if (n == "false") return false; |
897 if (n == null) return null; | 1205 if (n == null) return null; |
898 throw new core.ArgumentError("Invalid boolean: $n"); | 1206 throw new core.ArgumentError("Invalid boolean: $n"); |
899 } | 1207 } |
900 if (query.length > 0) { | 1208 if (query.length > 0) { |
901 for (var part in query.split("&")) { | 1209 for (var part in query.split("&")) { |
902 var keyvalue = part.split("="); | 1210 var keyvalue = part.split("="); |
903 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1211 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
904 } | 1212 } |
905 } | 1213 } |
| 1214 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
906 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1215 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
907 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1216 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
908 | 1217 |
909 | 1218 |
910 var h = { | 1219 var h = { |
911 "content-type" : "application/json; charset=utf-8", | 1220 "content-type" : "application/json; charset=utf-8", |
912 }; | 1221 }; |
913 var resp = convert.JSON.encode(buildManifestsListResponse()); | 1222 var resp = convert.JSON.encode(buildManifestsListResponse()); |
914 return new async.Future.value(stringResponse(200, h, resp)); | 1223 return new async.Future.value(stringResponse(200, h, resp)); |
915 }), true); | 1224 }), true); |
916 res.list(arg_project, arg_deployment, maxResults: arg_maxResults, pageToke
n: arg_pageToken).then(unittest.expectAsync(((api.ManifestsListResponse response
) { | 1225 res.list(arg_project, arg_deployment, filter: arg_filter, maxResults: arg_
maxResults, pageToken: arg_pageToken).then(unittest.expectAsync(((api.ManifestsL
istResponse response) { |
917 checkManifestsListResponse(response); | 1226 checkManifestsListResponse(response); |
918 }))); | 1227 }))); |
919 }); | 1228 }); |
920 | 1229 |
921 }); | 1230 }); |
922 | 1231 |
923 | 1232 |
924 unittest.group("resource-OperationsResourceApi", () { | 1233 unittest.group("resource-OperationsResourceApi", () { |
925 unittest.test("method--get", () { | 1234 unittest.test("method--get", () { |
926 | 1235 |
(...skipping 36 matching lines...) Loading... |
963 res.get(arg_project, arg_operation).then(unittest.expectAsync(((api.Operat
ion response) { | 1272 res.get(arg_project, arg_operation).then(unittest.expectAsync(((api.Operat
ion response) { |
964 checkOperation(response); | 1273 checkOperation(response); |
965 }))); | 1274 }))); |
966 }); | 1275 }); |
967 | 1276 |
968 unittest.test("method--list", () { | 1277 unittest.test("method--list", () { |
969 | 1278 |
970 var mock = new HttpServerMock(); | 1279 var mock = new HttpServerMock(); |
971 api.OperationsResourceApi res = new api.DeploymentmanagerApi(mock).operati
ons; | 1280 api.OperationsResourceApi res = new api.DeploymentmanagerApi(mock).operati
ons; |
972 var arg_project = "foo"; | 1281 var arg_project = "foo"; |
| 1282 var arg_filter = "foo"; |
973 var arg_maxResults = 42; | 1283 var arg_maxResults = 42; |
974 var arg_pageToken = "foo"; | 1284 var arg_pageToken = "foo"; |
975 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1285 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
976 var path = (req.url).path; | 1286 var path = (req.url).path; |
977 var pathOffset = 0; | 1287 var pathOffset = 0; |
978 var index; | 1288 var index; |
979 var subPart; | 1289 var subPart; |
980 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1290 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
981 pathOffset += 1; | 1291 pathOffset += 1; |
982 | 1292 |
983 var query = (req.url).query; | 1293 var query = (req.url).query; |
984 var queryOffset = 0; | 1294 var queryOffset = 0; |
985 var queryMap = {}; | 1295 var queryMap = {}; |
986 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1296 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
987 parseBool(n) { | 1297 parseBool(n) { |
988 if (n == "true") return true; | 1298 if (n == "true") return true; |
989 if (n == "false") return false; | 1299 if (n == "false") return false; |
990 if (n == null) return null; | 1300 if (n == null) return null; |
991 throw new core.ArgumentError("Invalid boolean: $n"); | 1301 throw new core.ArgumentError("Invalid boolean: $n"); |
992 } | 1302 } |
993 if (query.length > 0) { | 1303 if (query.length > 0) { |
994 for (var part in query.split("&")) { | 1304 for (var part in query.split("&")) { |
995 var keyvalue = part.split("="); | 1305 var keyvalue = part.split("="); |
996 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1306 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
997 } | 1307 } |
998 } | 1308 } |
| 1309 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
999 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1310 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
1000 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1311 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1001 | 1312 |
1002 | 1313 |
1003 var h = { | 1314 var h = { |
1004 "content-type" : "application/json; charset=utf-8", | 1315 "content-type" : "application/json; charset=utf-8", |
1005 }; | 1316 }; |
1006 var resp = convert.JSON.encode(buildOperationsListResponse()); | 1317 var resp = convert.JSON.encode(buildOperationsListResponse()); |
1007 return new async.Future.value(stringResponse(200, h, resp)); | 1318 return new async.Future.value(stringResponse(200, h, resp)); |
1008 }), true); | 1319 }), true); |
1009 res.list(arg_project, maxResults: arg_maxResults, pageToken: arg_pageToken
).then(unittest.expectAsync(((api.OperationsListResponse response) { | 1320 res.list(arg_project, filter: arg_filter, maxResults: arg_maxResults, page
Token: arg_pageToken).then(unittest.expectAsync(((api.OperationsListResponse res
ponse) { |
1010 checkOperationsListResponse(response); | 1321 checkOperationsListResponse(response); |
1011 }))); | 1322 }))); |
1012 }); | 1323 }); |
1013 | 1324 |
1014 }); | 1325 }); |
1015 | 1326 |
1016 | 1327 |
1017 unittest.group("resource-ResourcesResourceApi", () { | 1328 unittest.group("resource-ResourcesResourceApi", () { |
1018 unittest.test("method--get", () { | 1329 unittest.test("method--get", () { |
1019 | 1330 |
(...skipping 38 matching lines...) Loading... |
1058 checkResource(response); | 1369 checkResource(response); |
1059 }))); | 1370 }))); |
1060 }); | 1371 }); |
1061 | 1372 |
1062 unittest.test("method--list", () { | 1373 unittest.test("method--list", () { |
1063 | 1374 |
1064 var mock = new HttpServerMock(); | 1375 var mock = new HttpServerMock(); |
1065 api.ResourcesResourceApi res = new api.DeploymentmanagerApi(mock).resource
s; | 1376 api.ResourcesResourceApi res = new api.DeploymentmanagerApi(mock).resource
s; |
1066 var arg_project = "foo"; | 1377 var arg_project = "foo"; |
1067 var arg_deployment = "foo"; | 1378 var arg_deployment = "foo"; |
| 1379 var arg_filter = "foo"; |
1068 var arg_maxResults = 42; | 1380 var arg_maxResults = 42; |
1069 var arg_pageToken = "foo"; | 1381 var arg_pageToken = "foo"; |
1070 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1382 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1071 var path = (req.url).path; | 1383 var path = (req.url).path; |
1072 var pathOffset = 0; | 1384 var pathOffset = 0; |
1073 var index; | 1385 var index; |
1074 var subPart; | 1386 var subPart; |
1075 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1387 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1076 pathOffset += 1; | 1388 pathOffset += 1; |
1077 | 1389 |
1078 var query = (req.url).query; | 1390 var query = (req.url).query; |
1079 var queryOffset = 0; | 1391 var queryOffset = 0; |
1080 var queryMap = {}; | 1392 var queryMap = {}; |
1081 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1393 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1082 parseBool(n) { | 1394 parseBool(n) { |
1083 if (n == "true") return true; | 1395 if (n == "true") return true; |
1084 if (n == "false") return false; | 1396 if (n == "false") return false; |
1085 if (n == null) return null; | 1397 if (n == null) return null; |
1086 throw new core.ArgumentError("Invalid boolean: $n"); | 1398 throw new core.ArgumentError("Invalid boolean: $n"); |
1087 } | 1399 } |
1088 if (query.length > 0) { | 1400 if (query.length > 0) { |
1089 for (var part in query.split("&")) { | 1401 for (var part in query.split("&")) { |
1090 var keyvalue = part.split("="); | 1402 var keyvalue = part.split("="); |
1091 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1403 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1092 } | 1404 } |
1093 } | 1405 } |
| 1406 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
1094 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1407 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
1095 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1408 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1096 | 1409 |
1097 | 1410 |
1098 var h = { | 1411 var h = { |
1099 "content-type" : "application/json; charset=utf-8", | 1412 "content-type" : "application/json; charset=utf-8", |
1100 }; | 1413 }; |
1101 var resp = convert.JSON.encode(buildResourcesListResponse()); | 1414 var resp = convert.JSON.encode(buildResourcesListResponse()); |
1102 return new async.Future.value(stringResponse(200, h, resp)); | 1415 return new async.Future.value(stringResponse(200, h, resp)); |
1103 }), true); | 1416 }), true); |
1104 res.list(arg_project, arg_deployment, maxResults: arg_maxResults, pageToke
n: arg_pageToken).then(unittest.expectAsync(((api.ResourcesListResponse response
) { | 1417 res.list(arg_project, arg_deployment, filter: arg_filter, maxResults: arg_
maxResults, pageToken: arg_pageToken).then(unittest.expectAsync(((api.ResourcesL
istResponse response) { |
1105 checkResourcesListResponse(response); | 1418 checkResourcesListResponse(response); |
1106 }))); | 1419 }))); |
1107 }); | 1420 }); |
1108 | 1421 |
1109 }); | 1422 }); |
1110 | 1423 |
1111 | 1424 |
1112 unittest.group("resource-TypesResourceApi", () { | 1425 unittest.group("resource-TypesResourceApi", () { |
1113 unittest.test("method--list", () { | 1426 unittest.test("method--list", () { |
1114 | 1427 |
1115 var mock = new HttpServerMock(); | 1428 var mock = new HttpServerMock(); |
1116 api.TypesResourceApi res = new api.DeploymentmanagerApi(mock).types; | 1429 api.TypesResourceApi res = new api.DeploymentmanagerApi(mock).types; |
1117 var arg_project = "foo"; | 1430 var arg_project = "foo"; |
| 1431 var arg_filter = "foo"; |
1118 var arg_maxResults = 42; | 1432 var arg_maxResults = 42; |
1119 var arg_pageToken = "foo"; | 1433 var arg_pageToken = "foo"; |
1120 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1434 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1121 var path = (req.url).path; | 1435 var path = (req.url).path; |
1122 var pathOffset = 0; | 1436 var pathOffset = 0; |
1123 var index; | 1437 var index; |
1124 var subPart; | 1438 var subPart; |
1125 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1439 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1126 pathOffset += 1; | 1440 pathOffset += 1; |
1127 | 1441 |
1128 var query = (req.url).query; | 1442 var query = (req.url).query; |
1129 var queryOffset = 0; | 1443 var queryOffset = 0; |
1130 var queryMap = {}; | 1444 var queryMap = {}; |
1131 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1445 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1132 parseBool(n) { | 1446 parseBool(n) { |
1133 if (n == "true") return true; | 1447 if (n == "true") return true; |
1134 if (n == "false") return false; | 1448 if (n == "false") return false; |
1135 if (n == null) return null; | 1449 if (n == null) return null; |
1136 throw new core.ArgumentError("Invalid boolean: $n"); | 1450 throw new core.ArgumentError("Invalid boolean: $n"); |
1137 } | 1451 } |
1138 if (query.length > 0) { | 1452 if (query.length > 0) { |
1139 for (var part in query.split("&")) { | 1453 for (var part in query.split("&")) { |
1140 var keyvalue = part.split("="); | 1454 var keyvalue = part.split("="); |
1141 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1455 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1142 } | 1456 } |
1143 } | 1457 } |
| 1458 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
1144 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1459 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
1145 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1460 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1146 | 1461 |
1147 | 1462 |
1148 var h = { | 1463 var h = { |
1149 "content-type" : "application/json; charset=utf-8", | 1464 "content-type" : "application/json; charset=utf-8", |
1150 }; | 1465 }; |
1151 var resp = convert.JSON.encode(buildTypesListResponse()); | 1466 var resp = convert.JSON.encode(buildTypesListResponse()); |
1152 return new async.Future.value(stringResponse(200, h, resp)); | 1467 return new async.Future.value(stringResponse(200, h, resp)); |
1153 }), true); | 1468 }), true); |
1154 res.list(arg_project, maxResults: arg_maxResults, pageToken: arg_pageToken
).then(unittest.expectAsync(((api.TypesListResponse response) { | 1469 res.list(arg_project, filter: arg_filter, maxResults: arg_maxResults, page
Token: arg_pageToken).then(unittest.expectAsync(((api.TypesListResponse response
) { |
1155 checkTypesListResponse(response); | 1470 checkTypesListResponse(response); |
1156 }))); | 1471 }))); |
1157 }); | 1472 }); |
1158 | 1473 |
1159 }); | 1474 }); |
1160 | 1475 |
1161 | 1476 |
1162 } | 1477 } |
1163 | 1478 |
OLD | NEW |