OLD | NEW |
1 library googleapis.storagetransfer.v1.test; | 1 library googleapis.storagetransfer.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:test/test.dart' as unittest; |
11 | 11 |
12 import 'package:googleapis/storagetransfer/v1.dart' as api; | 12 import 'package:googleapis/storagetransfer/v1.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; |
(...skipping 18 matching lines...) Expand all Loading... |
39 } else { | 39 } else { |
40 return stream.toBytes().then((data) { | 40 return stream.toBytes().then((data) { |
41 return _callback(request, data); | 41 return _callback(request, data); |
42 }); | 42 }); |
43 } | 43 } |
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<core.String, core.String> headers, core.String bod
y) { |
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 buildCounterAwsAccessKey = 0; | 54 core.int buildCounterAwsAccessKey = 0; |
55 buildAwsAccessKey() { | 55 buildAwsAccessKey() { |
56 var o = new api.AwsAccessKey(); | 56 var o = new api.AwsAccessKey(); |
57 buildCounterAwsAccessKey++; | 57 buildCounterAwsAccessKey++; |
58 if (buildCounterAwsAccessKey < 3) { | 58 if (buildCounterAwsAccessKey < 3) { |
59 o.accessKeyId = "foo"; | 59 o.accessKeyId = "foo"; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 return o; | 126 return o; |
127 } | 127 } |
128 | 128 |
129 checkEmpty(api.Empty o) { | 129 checkEmpty(api.Empty o) { |
130 buildCounterEmpty++; | 130 buildCounterEmpty++; |
131 if (buildCounterEmpty < 3) { | 131 if (buildCounterEmpty < 3) { |
132 } | 132 } |
133 buildCounterEmpty--; | 133 buildCounterEmpty--; |
134 } | 134 } |
135 | 135 |
136 buildUnnamed1322() { | 136 buildUnnamed1329() { |
137 var o = new core.List<core.String>(); | 137 var o = new core.List<core.String>(); |
138 o.add("foo"); | 138 o.add("foo"); |
139 o.add("foo"); | 139 o.add("foo"); |
140 return o; | 140 return o; |
141 } | 141 } |
142 | 142 |
143 checkUnnamed1322(core.List<core.String> o) { | 143 checkUnnamed1329(core.List<core.String> o) { |
144 unittest.expect(o, unittest.hasLength(2)); | 144 unittest.expect(o, unittest.hasLength(2)); |
145 unittest.expect(o[0], unittest.equals('foo')); | 145 unittest.expect(o[0], unittest.equals('foo')); |
146 unittest.expect(o[1], unittest.equals('foo')); | 146 unittest.expect(o[1], unittest.equals('foo')); |
147 } | 147 } |
148 | 148 |
149 core.int buildCounterErrorLogEntry = 0; | 149 core.int buildCounterErrorLogEntry = 0; |
150 buildErrorLogEntry() { | 150 buildErrorLogEntry() { |
151 var o = new api.ErrorLogEntry(); | 151 var o = new api.ErrorLogEntry(); |
152 buildCounterErrorLogEntry++; | 152 buildCounterErrorLogEntry++; |
153 if (buildCounterErrorLogEntry < 3) { | 153 if (buildCounterErrorLogEntry < 3) { |
154 o.errorDetails = buildUnnamed1322(); | 154 o.errorDetails = buildUnnamed1329(); |
155 o.url = "foo"; | 155 o.url = "foo"; |
156 } | 156 } |
157 buildCounterErrorLogEntry--; | 157 buildCounterErrorLogEntry--; |
158 return o; | 158 return o; |
159 } | 159 } |
160 | 160 |
161 checkErrorLogEntry(api.ErrorLogEntry o) { | 161 checkErrorLogEntry(api.ErrorLogEntry o) { |
162 buildCounterErrorLogEntry++; | 162 buildCounterErrorLogEntry++; |
163 if (buildCounterErrorLogEntry < 3) { | 163 if (buildCounterErrorLogEntry < 3) { |
164 checkUnnamed1322(o.errorDetails); | 164 checkUnnamed1329(o.errorDetails); |
165 unittest.expect(o.url, unittest.equals('foo')); | 165 unittest.expect(o.url, unittest.equals('foo')); |
166 } | 166 } |
167 buildCounterErrorLogEntry--; | 167 buildCounterErrorLogEntry--; |
168 } | 168 } |
169 | 169 |
170 buildUnnamed1323() { | 170 buildUnnamed1330() { |
171 var o = new core.List<api.ErrorLogEntry>(); | 171 var o = new core.List<api.ErrorLogEntry>(); |
172 o.add(buildErrorLogEntry()); | 172 o.add(buildErrorLogEntry()); |
173 o.add(buildErrorLogEntry()); | 173 o.add(buildErrorLogEntry()); |
174 return o; | 174 return o; |
175 } | 175 } |
176 | 176 |
177 checkUnnamed1323(core.List<api.ErrorLogEntry> o) { | 177 checkUnnamed1330(core.List<api.ErrorLogEntry> o) { |
178 unittest.expect(o, unittest.hasLength(2)); | 178 unittest.expect(o, unittest.hasLength(2)); |
179 checkErrorLogEntry(o[0]); | 179 checkErrorLogEntry(o[0]); |
180 checkErrorLogEntry(o[1]); | 180 checkErrorLogEntry(o[1]); |
181 } | 181 } |
182 | 182 |
183 core.int buildCounterErrorSummary = 0; | 183 core.int buildCounterErrorSummary = 0; |
184 buildErrorSummary() { | 184 buildErrorSummary() { |
185 var o = new api.ErrorSummary(); | 185 var o = new api.ErrorSummary(); |
186 buildCounterErrorSummary++; | 186 buildCounterErrorSummary++; |
187 if (buildCounterErrorSummary < 3) { | 187 if (buildCounterErrorSummary < 3) { |
188 o.errorCode = "foo"; | 188 o.errorCode = "foo"; |
189 o.errorCount = "foo"; | 189 o.errorCount = "foo"; |
190 o.errorLogEntries = buildUnnamed1323(); | 190 o.errorLogEntries = buildUnnamed1330(); |
191 } | 191 } |
192 buildCounterErrorSummary--; | 192 buildCounterErrorSummary--; |
193 return o; | 193 return o; |
194 } | 194 } |
195 | 195 |
196 checkErrorSummary(api.ErrorSummary o) { | 196 checkErrorSummary(api.ErrorSummary o) { |
197 buildCounterErrorSummary++; | 197 buildCounterErrorSummary++; |
198 if (buildCounterErrorSummary < 3) { | 198 if (buildCounterErrorSummary < 3) { |
199 unittest.expect(o.errorCode, unittest.equals('foo')); | 199 unittest.expect(o.errorCode, unittest.equals('foo')); |
200 unittest.expect(o.errorCount, unittest.equals('foo')); | 200 unittest.expect(o.errorCount, unittest.equals('foo')); |
201 checkUnnamed1323(o.errorLogEntries); | 201 checkUnnamed1330(o.errorLogEntries); |
202 } | 202 } |
203 buildCounterErrorSummary--; | 203 buildCounterErrorSummary--; |
204 } | 204 } |
205 | 205 |
206 core.int buildCounterGcsData = 0; | 206 core.int buildCounterGcsData = 0; |
207 buildGcsData() { | 207 buildGcsData() { |
208 var o = new api.GcsData(); | 208 var o = new api.GcsData(); |
209 buildCounterGcsData++; | 209 buildCounterGcsData++; |
210 if (buildCounterGcsData < 3) { | 210 if (buildCounterGcsData < 3) { |
211 o.bucketName = "foo"; | 211 o.bucketName = "foo"; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 253 } |
254 | 254 |
255 checkHttpData(api.HttpData o) { | 255 checkHttpData(api.HttpData o) { |
256 buildCounterHttpData++; | 256 buildCounterHttpData++; |
257 if (buildCounterHttpData < 3) { | 257 if (buildCounterHttpData < 3) { |
258 unittest.expect(o.listUrl, unittest.equals('foo')); | 258 unittest.expect(o.listUrl, unittest.equals('foo')); |
259 } | 259 } |
260 buildCounterHttpData--; | 260 buildCounterHttpData--; |
261 } | 261 } |
262 | 262 |
263 buildUnnamed1324() { | 263 buildUnnamed1331() { |
264 var o = new core.List<api.Operation>(); | 264 var o = new core.List<api.Operation>(); |
265 o.add(buildOperation()); | 265 o.add(buildOperation()); |
266 o.add(buildOperation()); | 266 o.add(buildOperation()); |
267 return o; | 267 return o; |
268 } | 268 } |
269 | 269 |
270 checkUnnamed1324(core.List<api.Operation> o) { | 270 checkUnnamed1331(core.List<api.Operation> o) { |
271 unittest.expect(o, unittest.hasLength(2)); | 271 unittest.expect(o, unittest.hasLength(2)); |
272 checkOperation(o[0]); | 272 checkOperation(o[0]); |
273 checkOperation(o[1]); | 273 checkOperation(o[1]); |
274 } | 274 } |
275 | 275 |
276 core.int buildCounterListOperationsResponse = 0; | 276 core.int buildCounterListOperationsResponse = 0; |
277 buildListOperationsResponse() { | 277 buildListOperationsResponse() { |
278 var o = new api.ListOperationsResponse(); | 278 var o = new api.ListOperationsResponse(); |
279 buildCounterListOperationsResponse++; | 279 buildCounterListOperationsResponse++; |
280 if (buildCounterListOperationsResponse < 3) { | 280 if (buildCounterListOperationsResponse < 3) { |
281 o.nextPageToken = "foo"; | 281 o.nextPageToken = "foo"; |
282 o.operations = buildUnnamed1324(); | 282 o.operations = buildUnnamed1331(); |
283 } | 283 } |
284 buildCounterListOperationsResponse--; | 284 buildCounterListOperationsResponse--; |
285 return o; | 285 return o; |
286 } | 286 } |
287 | 287 |
288 checkListOperationsResponse(api.ListOperationsResponse o) { | 288 checkListOperationsResponse(api.ListOperationsResponse o) { |
289 buildCounterListOperationsResponse++; | 289 buildCounterListOperationsResponse++; |
290 if (buildCounterListOperationsResponse < 3) { | 290 if (buildCounterListOperationsResponse < 3) { |
291 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 291 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
292 checkUnnamed1324(o.operations); | 292 checkUnnamed1331(o.operations); |
293 } | 293 } |
294 buildCounterListOperationsResponse--; | 294 buildCounterListOperationsResponse--; |
295 } | 295 } |
296 | 296 |
297 buildUnnamed1325() { | 297 buildUnnamed1332() { |
298 var o = new core.List<api.TransferJob>(); | 298 var o = new core.List<api.TransferJob>(); |
299 o.add(buildTransferJob()); | 299 o.add(buildTransferJob()); |
300 o.add(buildTransferJob()); | 300 o.add(buildTransferJob()); |
301 return o; | 301 return o; |
302 } | 302 } |
303 | 303 |
304 checkUnnamed1325(core.List<api.TransferJob> o) { | 304 checkUnnamed1332(core.List<api.TransferJob> o) { |
305 unittest.expect(o, unittest.hasLength(2)); | 305 unittest.expect(o, unittest.hasLength(2)); |
306 checkTransferJob(o[0]); | 306 checkTransferJob(o[0]); |
307 checkTransferJob(o[1]); | 307 checkTransferJob(o[1]); |
308 } | 308 } |
309 | 309 |
310 core.int buildCounterListTransferJobsResponse = 0; | 310 core.int buildCounterListTransferJobsResponse = 0; |
311 buildListTransferJobsResponse() { | 311 buildListTransferJobsResponse() { |
312 var o = new api.ListTransferJobsResponse(); | 312 var o = new api.ListTransferJobsResponse(); |
313 buildCounterListTransferJobsResponse++; | 313 buildCounterListTransferJobsResponse++; |
314 if (buildCounterListTransferJobsResponse < 3) { | 314 if (buildCounterListTransferJobsResponse < 3) { |
315 o.nextPageToken = "foo"; | 315 o.nextPageToken = "foo"; |
316 o.transferJobs = buildUnnamed1325(); | 316 o.transferJobs = buildUnnamed1332(); |
317 } | 317 } |
318 buildCounterListTransferJobsResponse--; | 318 buildCounterListTransferJobsResponse--; |
319 return o; | 319 return o; |
320 } | 320 } |
321 | 321 |
322 checkListTransferJobsResponse(api.ListTransferJobsResponse o) { | 322 checkListTransferJobsResponse(api.ListTransferJobsResponse o) { |
323 buildCounterListTransferJobsResponse++; | 323 buildCounterListTransferJobsResponse++; |
324 if (buildCounterListTransferJobsResponse < 3) { | 324 if (buildCounterListTransferJobsResponse < 3) { |
325 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 325 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
326 checkUnnamed1325(o.transferJobs); | 326 checkUnnamed1332(o.transferJobs); |
327 } | 327 } |
328 buildCounterListTransferJobsResponse--; | 328 buildCounterListTransferJobsResponse--; |
329 } | 329 } |
330 | 330 |
331 buildUnnamed1326() { | 331 buildUnnamed1333() { |
332 var o = new core.List<core.String>(); | 332 var o = new core.List<core.String>(); |
333 o.add("foo"); | 333 o.add("foo"); |
334 o.add("foo"); | 334 o.add("foo"); |
335 return o; | 335 return o; |
336 } | 336 } |
337 | 337 |
338 checkUnnamed1326(core.List<core.String> o) { | 338 checkUnnamed1333(core.List<core.String> o) { |
339 unittest.expect(o, unittest.hasLength(2)); | 339 unittest.expect(o, unittest.hasLength(2)); |
340 unittest.expect(o[0], unittest.equals('foo')); | 340 unittest.expect(o[0], unittest.equals('foo')); |
341 unittest.expect(o[1], unittest.equals('foo')); | 341 unittest.expect(o[1], unittest.equals('foo')); |
342 } | 342 } |
343 | 343 |
344 buildUnnamed1327() { | 344 buildUnnamed1334() { |
345 var o = new core.List<core.String>(); | 345 var o = new core.List<core.String>(); |
346 o.add("foo"); | 346 o.add("foo"); |
347 o.add("foo"); | 347 o.add("foo"); |
348 return o; | 348 return o; |
349 } | 349 } |
350 | 350 |
351 checkUnnamed1327(core.List<core.String> o) { | 351 checkUnnamed1334(core.List<core.String> o) { |
352 unittest.expect(o, unittest.hasLength(2)); | 352 unittest.expect(o, unittest.hasLength(2)); |
353 unittest.expect(o[0], unittest.equals('foo')); | 353 unittest.expect(o[0], unittest.equals('foo')); |
354 unittest.expect(o[1], unittest.equals('foo')); | 354 unittest.expect(o[1], unittest.equals('foo')); |
355 } | 355 } |
356 | 356 |
357 core.int buildCounterObjectConditions = 0; | 357 core.int buildCounterObjectConditions = 0; |
358 buildObjectConditions() { | 358 buildObjectConditions() { |
359 var o = new api.ObjectConditions(); | 359 var o = new api.ObjectConditions(); |
360 buildCounterObjectConditions++; | 360 buildCounterObjectConditions++; |
361 if (buildCounterObjectConditions < 3) { | 361 if (buildCounterObjectConditions < 3) { |
362 o.excludePrefixes = buildUnnamed1326(); | 362 o.excludePrefixes = buildUnnamed1333(); |
363 o.includePrefixes = buildUnnamed1327(); | 363 o.includePrefixes = buildUnnamed1334(); |
364 o.maxTimeElapsedSinceLastModification = "foo"; | 364 o.maxTimeElapsedSinceLastModification = "foo"; |
365 o.minTimeElapsedSinceLastModification = "foo"; | 365 o.minTimeElapsedSinceLastModification = "foo"; |
366 } | 366 } |
367 buildCounterObjectConditions--; | 367 buildCounterObjectConditions--; |
368 return o; | 368 return o; |
369 } | 369 } |
370 | 370 |
371 checkObjectConditions(api.ObjectConditions o) { | 371 checkObjectConditions(api.ObjectConditions o) { |
372 buildCounterObjectConditions++; | 372 buildCounterObjectConditions++; |
373 if (buildCounterObjectConditions < 3) { | 373 if (buildCounterObjectConditions < 3) { |
374 checkUnnamed1326(o.excludePrefixes); | 374 checkUnnamed1333(o.excludePrefixes); |
375 checkUnnamed1327(o.includePrefixes); | 375 checkUnnamed1334(o.includePrefixes); |
376 unittest.expect(o.maxTimeElapsedSinceLastModification, unittest.equals('foo'
)); | 376 unittest.expect(o.maxTimeElapsedSinceLastModification, unittest.equals('foo'
)); |
377 unittest.expect(o.minTimeElapsedSinceLastModification, unittest.equals('foo'
)); | 377 unittest.expect(o.minTimeElapsedSinceLastModification, unittest.equals('foo'
)); |
378 } | 378 } |
379 buildCounterObjectConditions--; | 379 buildCounterObjectConditions--; |
380 } | 380 } |
381 | 381 |
382 buildUnnamed1328() { | 382 buildUnnamed1335() { |
383 var o = new core.Map<core.String, core.Object>(); | 383 var o = new core.Map<core.String, core.Object>(); |
384 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 384 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
385 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 385 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
386 return o; | 386 return o; |
387 } | 387 } |
388 | 388 |
389 checkUnnamed1328(core.Map<core.String, core.Object> o) { | 389 checkUnnamed1335(core.Map<core.String, core.Object> o) { |
390 unittest.expect(o, unittest.hasLength(2)); | 390 unittest.expect(o, unittest.hasLength(2)); |
391 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); | 391 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); |
392 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); | 392 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); |
393 } | 393 } |
394 | 394 |
395 buildUnnamed1329() { | 395 buildUnnamed1336() { |
396 var o = new core.Map<core.String, core.Object>(); | 396 var o = new core.Map<core.String, core.Object>(); |
397 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 397 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
398 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 398 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
399 return o; | 399 return o; |
400 } | 400 } |
401 | 401 |
402 checkUnnamed1329(core.Map<core.String, core.Object> o) { | 402 checkUnnamed1336(core.Map<core.String, core.Object> o) { |
403 unittest.expect(o, unittest.hasLength(2)); | 403 unittest.expect(o, unittest.hasLength(2)); |
404 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); | 404 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); |
405 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); | 405 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); |
406 } | 406 } |
407 | 407 |
408 core.int buildCounterOperation = 0; | 408 core.int buildCounterOperation = 0; |
409 buildOperation() { | 409 buildOperation() { |
410 var o = new api.Operation(); | 410 var o = new api.Operation(); |
411 buildCounterOperation++; | 411 buildCounterOperation++; |
412 if (buildCounterOperation < 3) { | 412 if (buildCounterOperation < 3) { |
413 o.done = true; | 413 o.done = true; |
414 o.error = buildStatus(); | 414 o.error = buildStatus(); |
415 o.metadata = buildUnnamed1328(); | 415 o.metadata = buildUnnamed1335(); |
416 o.name = "foo"; | 416 o.name = "foo"; |
417 o.response = buildUnnamed1329(); | 417 o.response = buildUnnamed1336(); |
418 } | 418 } |
419 buildCounterOperation--; | 419 buildCounterOperation--; |
420 return o; | 420 return o; |
421 } | 421 } |
422 | 422 |
423 checkOperation(api.Operation o) { | 423 checkOperation(api.Operation o) { |
424 buildCounterOperation++; | 424 buildCounterOperation++; |
425 if (buildCounterOperation < 3) { | 425 if (buildCounterOperation < 3) { |
426 unittest.expect(o.done, unittest.isTrue); | 426 unittest.expect(o.done, unittest.isTrue); |
427 checkStatus(o.error); | 427 checkStatus(o.error); |
428 checkUnnamed1328(o.metadata); | 428 checkUnnamed1335(o.metadata); |
429 unittest.expect(o.name, unittest.equals('foo')); | 429 unittest.expect(o.name, unittest.equals('foo')); |
430 checkUnnamed1329(o.response); | 430 checkUnnamed1336(o.response); |
431 } | 431 } |
432 buildCounterOperation--; | 432 buildCounterOperation--; |
433 } | 433 } |
434 | 434 |
435 core.int buildCounterPauseTransferOperationRequest = 0; | 435 core.int buildCounterPauseTransferOperationRequest = 0; |
436 buildPauseTransferOperationRequest() { | 436 buildPauseTransferOperationRequest() { |
437 var o = new api.PauseTransferOperationRequest(); | 437 var o = new api.PauseTransferOperationRequest(); |
438 buildCounterPauseTransferOperationRequest++; | 438 buildCounterPauseTransferOperationRequest++; |
439 if (buildCounterPauseTransferOperationRequest < 3) { | 439 if (buildCounterPauseTransferOperationRequest < 3) { |
440 } | 440 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 checkSchedule(api.Schedule o) { | 482 checkSchedule(api.Schedule o) { |
483 buildCounterSchedule++; | 483 buildCounterSchedule++; |
484 if (buildCounterSchedule < 3) { | 484 if (buildCounterSchedule < 3) { |
485 checkDate(o.scheduleEndDate); | 485 checkDate(o.scheduleEndDate); |
486 checkDate(o.scheduleStartDate); | 486 checkDate(o.scheduleStartDate); |
487 checkTimeOfDay(o.startTimeOfDay); | 487 checkTimeOfDay(o.startTimeOfDay); |
488 } | 488 } |
489 buildCounterSchedule--; | 489 buildCounterSchedule--; |
490 } | 490 } |
491 | 491 |
492 buildUnnamed1330() { | 492 buildUnnamed1337() { |
493 var o = new core.Map<core.String, core.Object>(); | 493 var o = new core.Map<core.String, core.Object>(); |
494 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 494 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
495 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 495 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
496 return o; | 496 return o; |
497 } | 497 } |
498 | 498 |
499 checkUnnamed1330(core.Map<core.String, core.Object> o) { | 499 checkUnnamed1337(core.Map<core.String, core.Object> o) { |
500 unittest.expect(o, unittest.hasLength(2)); | 500 unittest.expect(o, unittest.hasLength(2)); |
501 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); | 501 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); |
502 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); | 502 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); |
503 } | 503 } |
504 | 504 |
505 buildUnnamed1331() { | 505 buildUnnamed1338() { |
506 var o = new core.List<core.Map<core.String, core.Object>>(); | 506 var o = new core.List<core.Map<core.String, core.Object>>(); |
507 o.add(buildUnnamed1330()); | 507 o.add(buildUnnamed1337()); |
508 o.add(buildUnnamed1330()); | 508 o.add(buildUnnamed1337()); |
509 return o; | 509 return o; |
510 } | 510 } |
511 | 511 |
512 checkUnnamed1331(core.List<core.Map<core.String, core.Object>> o) { | 512 checkUnnamed1338(core.List<core.Map<core.String, core.Object>> o) { |
513 unittest.expect(o, unittest.hasLength(2)); | 513 unittest.expect(o, unittest.hasLength(2)); |
514 checkUnnamed1330(o[0]); | 514 checkUnnamed1337(o[0]); |
515 checkUnnamed1330(o[1]); | 515 checkUnnamed1337(o[1]); |
516 } | 516 } |
517 | 517 |
518 core.int buildCounterStatus = 0; | 518 core.int buildCounterStatus = 0; |
519 buildStatus() { | 519 buildStatus() { |
520 var o = new api.Status(); | 520 var o = new api.Status(); |
521 buildCounterStatus++; | 521 buildCounterStatus++; |
522 if (buildCounterStatus < 3) { | 522 if (buildCounterStatus < 3) { |
523 o.code = 42; | 523 o.code = 42; |
524 o.details = buildUnnamed1331(); | 524 o.details = buildUnnamed1338(); |
525 o.message = "foo"; | 525 o.message = "foo"; |
526 } | 526 } |
527 buildCounterStatus--; | 527 buildCounterStatus--; |
528 return o; | 528 return o; |
529 } | 529 } |
530 | 530 |
531 checkStatus(api.Status o) { | 531 checkStatus(api.Status o) { |
532 buildCounterStatus++; | 532 buildCounterStatus++; |
533 if (buildCounterStatus < 3) { | 533 if (buildCounterStatus < 3) { |
534 unittest.expect(o.code, unittest.equals(42)); | 534 unittest.expect(o.code, unittest.equals(42)); |
535 checkUnnamed1331(o.details); | 535 checkUnnamed1338(o.details); |
536 unittest.expect(o.message, unittest.equals('foo')); | 536 unittest.expect(o.message, unittest.equals('foo')); |
537 } | 537 } |
538 buildCounterStatus--; | 538 buildCounterStatus--; |
539 } | 539 } |
540 | 540 |
541 core.int buildCounterTimeOfDay = 0; | 541 core.int buildCounterTimeOfDay = 0; |
542 buildTimeOfDay() { | 542 buildTimeOfDay() { |
543 var o = new api.TimeOfDay(); | 543 var o = new api.TimeOfDay(); |
544 buildCounterTimeOfDay++; | 544 buildCounterTimeOfDay++; |
545 if (buildCounterTimeOfDay < 3) { | 545 if (buildCounterTimeOfDay < 3) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 unittest.expect(o.lastModificationTime, unittest.equals('foo')); | 640 unittest.expect(o.lastModificationTime, unittest.equals('foo')); |
641 unittest.expect(o.name, unittest.equals('foo')); | 641 unittest.expect(o.name, unittest.equals('foo')); |
642 unittest.expect(o.projectId, unittest.equals('foo')); | 642 unittest.expect(o.projectId, unittest.equals('foo')); |
643 checkSchedule(o.schedule); | 643 checkSchedule(o.schedule); |
644 unittest.expect(o.status, unittest.equals('foo')); | 644 unittest.expect(o.status, unittest.equals('foo')); |
645 checkTransferSpec(o.transferSpec); | 645 checkTransferSpec(o.transferSpec); |
646 } | 646 } |
647 buildCounterTransferJob--; | 647 buildCounterTransferJob--; |
648 } | 648 } |
649 | 649 |
650 buildUnnamed1332() { | 650 buildUnnamed1339() { |
651 var o = new core.List<api.ErrorSummary>(); | 651 var o = new core.List<api.ErrorSummary>(); |
652 o.add(buildErrorSummary()); | 652 o.add(buildErrorSummary()); |
653 o.add(buildErrorSummary()); | 653 o.add(buildErrorSummary()); |
654 return o; | 654 return o; |
655 } | 655 } |
656 | 656 |
657 checkUnnamed1332(core.List<api.ErrorSummary> o) { | 657 checkUnnamed1339(core.List<api.ErrorSummary> o) { |
658 unittest.expect(o, unittest.hasLength(2)); | 658 unittest.expect(o, unittest.hasLength(2)); |
659 checkErrorSummary(o[0]); | 659 checkErrorSummary(o[0]); |
660 checkErrorSummary(o[1]); | 660 checkErrorSummary(o[1]); |
661 } | 661 } |
662 | 662 |
663 core.int buildCounterTransferOperation = 0; | 663 core.int buildCounterTransferOperation = 0; |
664 buildTransferOperation() { | 664 buildTransferOperation() { |
665 var o = new api.TransferOperation(); | 665 var o = new api.TransferOperation(); |
666 buildCounterTransferOperation++; | 666 buildCounterTransferOperation++; |
667 if (buildCounterTransferOperation < 3) { | 667 if (buildCounterTransferOperation < 3) { |
668 o.counters = buildTransferCounters(); | 668 o.counters = buildTransferCounters(); |
669 o.endTime = "foo"; | 669 o.endTime = "foo"; |
670 o.errorBreakdowns = buildUnnamed1332(); | 670 o.errorBreakdowns = buildUnnamed1339(); |
671 o.name = "foo"; | 671 o.name = "foo"; |
672 o.projectId = "foo"; | 672 o.projectId = "foo"; |
673 o.startTime = "foo"; | 673 o.startTime = "foo"; |
674 o.status = "foo"; | 674 o.status = "foo"; |
675 o.transferJobName = "foo"; | 675 o.transferJobName = "foo"; |
676 o.transferSpec = buildTransferSpec(); | 676 o.transferSpec = buildTransferSpec(); |
677 } | 677 } |
678 buildCounterTransferOperation--; | 678 buildCounterTransferOperation--; |
679 return o; | 679 return o; |
680 } | 680 } |
681 | 681 |
682 checkTransferOperation(api.TransferOperation o) { | 682 checkTransferOperation(api.TransferOperation o) { |
683 buildCounterTransferOperation++; | 683 buildCounterTransferOperation++; |
684 if (buildCounterTransferOperation < 3) { | 684 if (buildCounterTransferOperation < 3) { |
685 checkTransferCounters(o.counters); | 685 checkTransferCounters(o.counters); |
686 unittest.expect(o.endTime, unittest.equals('foo')); | 686 unittest.expect(o.endTime, unittest.equals('foo')); |
687 checkUnnamed1332(o.errorBreakdowns); | 687 checkUnnamed1339(o.errorBreakdowns); |
688 unittest.expect(o.name, unittest.equals('foo')); | 688 unittest.expect(o.name, unittest.equals('foo')); |
689 unittest.expect(o.projectId, unittest.equals('foo')); | 689 unittest.expect(o.projectId, unittest.equals('foo')); |
690 unittest.expect(o.startTime, unittest.equals('foo')); | 690 unittest.expect(o.startTime, unittest.equals('foo')); |
691 unittest.expect(o.status, unittest.equals('foo')); | 691 unittest.expect(o.status, unittest.equals('foo')); |
692 unittest.expect(o.transferJobName, unittest.equals('foo')); | 692 unittest.expect(o.transferJobName, unittest.equals('foo')); |
693 checkTransferSpec(o.transferSpec); | 693 checkTransferSpec(o.transferSpec); |
694 } | 694 } |
695 buildCounterTransferOperation--; | 695 buildCounterTransferOperation--; |
696 } | 696 } |
697 | 697 |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 }); | 987 }); |
988 }); | 988 }); |
989 | 989 |
990 | 990 |
991 unittest.group("resource-GoogleServiceAccountsResourceApi", () { | 991 unittest.group("resource-GoogleServiceAccountsResourceApi", () { |
992 unittest.test("method--get", () { | 992 unittest.test("method--get", () { |
993 | 993 |
994 var mock = new HttpServerMock(); | 994 var mock = new HttpServerMock(); |
995 api.GoogleServiceAccountsResourceApi res = new api.StoragetransferApi(mock
).googleServiceAccounts; | 995 api.GoogleServiceAccountsResourceApi res = new api.StoragetransferApi(mock
).googleServiceAccounts; |
996 var arg_projectId = "foo"; | 996 var arg_projectId = "foo"; |
997 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 997 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
998 var path = (req.url).path; | 998 var path = (req.url).path; |
999 var pathOffset = 0; | 999 var pathOffset = 0; |
1000 var index; | 1000 var index; |
1001 var subPart; | 1001 var subPart; |
1002 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1002 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1003 pathOffset += 1; | 1003 pathOffset += 1; |
1004 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("v1/googleServiceAccounts/")); | 1004 unittest.expect(path.substring(pathOffset, pathOffset + 25), unittest.eq
uals("v1/googleServiceAccounts/")); |
1005 pathOffset += 25; | 1005 pathOffset += 25; |
1006 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 1006 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1007 pathOffset = path.length; | 1007 pathOffset = path.length; |
(...skipping 16 matching lines...) Expand all Loading... |
1024 } | 1024 } |
1025 } | 1025 } |
1026 | 1026 |
1027 | 1027 |
1028 var h = { | 1028 var h = { |
1029 "content-type" : "application/json; charset=utf-8", | 1029 "content-type" : "application/json; charset=utf-8", |
1030 }; | 1030 }; |
1031 var resp = convert.JSON.encode(buildGoogleServiceAccount()); | 1031 var resp = convert.JSON.encode(buildGoogleServiceAccount()); |
1032 return new async.Future.value(stringResponse(200, h, resp)); | 1032 return new async.Future.value(stringResponse(200, h, resp)); |
1033 }), true); | 1033 }), true); |
1034 res.get(arg_projectId).then(unittest.expectAsync(((api.GoogleServiceAccoun
t response) { | 1034 res.get(arg_projectId).then(unittest.expectAsync1(((api.GoogleServiceAccou
nt response) { |
1035 checkGoogleServiceAccount(response); | 1035 checkGoogleServiceAccount(response); |
1036 }))); | 1036 }))); |
1037 }); | 1037 }); |
1038 | 1038 |
1039 }); | 1039 }); |
1040 | 1040 |
1041 | 1041 |
1042 unittest.group("resource-TransferJobsResourceApi", () { | 1042 unittest.group("resource-TransferJobsResourceApi", () { |
1043 unittest.test("method--create", () { | 1043 unittest.test("method--create", () { |
1044 | 1044 |
1045 var mock = new HttpServerMock(); | 1045 var mock = new HttpServerMock(); |
1046 api.TransferJobsResourceApi res = new api.StoragetransferApi(mock).transfe
rJobs; | 1046 api.TransferJobsResourceApi res = new api.StoragetransferApi(mock).transfe
rJobs; |
1047 var arg_request = buildTransferJob(); | 1047 var arg_request = buildTransferJob(); |
1048 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1048 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1049 var obj = new api.TransferJob.fromJson(json); | 1049 var obj = new api.TransferJob.fromJson(json); |
1050 checkTransferJob(obj); | 1050 checkTransferJob(obj); |
1051 | 1051 |
1052 var path = (req.url).path; | 1052 var path = (req.url).path; |
1053 var pathOffset = 0; | 1053 var pathOffset = 0; |
1054 var index; | 1054 var index; |
1055 var subPart; | 1055 var subPart; |
1056 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1056 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1057 pathOffset += 1; | 1057 pathOffset += 1; |
1058 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("v1/transferJobs")); | 1058 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("v1/transferJobs")); |
(...skipping 16 matching lines...) Expand all Loading... |
1075 } | 1075 } |
1076 } | 1076 } |
1077 | 1077 |
1078 | 1078 |
1079 var h = { | 1079 var h = { |
1080 "content-type" : "application/json; charset=utf-8", | 1080 "content-type" : "application/json; charset=utf-8", |
1081 }; | 1081 }; |
1082 var resp = convert.JSON.encode(buildTransferJob()); | 1082 var resp = convert.JSON.encode(buildTransferJob()); |
1083 return new async.Future.value(stringResponse(200, h, resp)); | 1083 return new async.Future.value(stringResponse(200, h, resp)); |
1084 }), true); | 1084 }), true); |
1085 res.create(arg_request).then(unittest.expectAsync(((api.TransferJob respon
se) { | 1085 res.create(arg_request).then(unittest.expectAsync1(((api.TransferJob respo
nse) { |
1086 checkTransferJob(response); | 1086 checkTransferJob(response); |
1087 }))); | 1087 }))); |
1088 }); | 1088 }); |
1089 | 1089 |
1090 unittest.test("method--get", () { | 1090 unittest.test("method--get", () { |
1091 | 1091 |
1092 var mock = new HttpServerMock(); | 1092 var mock = new HttpServerMock(); |
1093 api.TransferJobsResourceApi res = new api.StoragetransferApi(mock).transfe
rJobs; | 1093 api.TransferJobsResourceApi res = new api.StoragetransferApi(mock).transfe
rJobs; |
1094 var arg_jobName = "foo"; | 1094 var arg_jobName = "foo"; |
1095 var arg_projectId = "foo"; | 1095 var arg_projectId = "foo"; |
1096 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1096 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1097 var path = (req.url).path; | 1097 var path = (req.url).path; |
1098 var pathOffset = 0; | 1098 var pathOffset = 0; |
1099 var index; | 1099 var index; |
1100 var subPart; | 1100 var subPart; |
1101 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1101 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1102 pathOffset += 1; | 1102 pathOffset += 1; |
1103 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1103 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
1104 pathOffset += 3; | 1104 pathOffset += 3; |
1105 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1105 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1106 | 1106 |
(...skipping 15 matching lines...) Expand all Loading... |
1122 } | 1122 } |
1123 unittest.expect(queryMap["projectId"].first, unittest.equals(arg_project
Id)); | 1123 unittest.expect(queryMap["projectId"].first, unittest.equals(arg_project
Id)); |
1124 | 1124 |
1125 | 1125 |
1126 var h = { | 1126 var h = { |
1127 "content-type" : "application/json; charset=utf-8", | 1127 "content-type" : "application/json; charset=utf-8", |
1128 }; | 1128 }; |
1129 var resp = convert.JSON.encode(buildTransferJob()); | 1129 var resp = convert.JSON.encode(buildTransferJob()); |
1130 return new async.Future.value(stringResponse(200, h, resp)); | 1130 return new async.Future.value(stringResponse(200, h, resp)); |
1131 }), true); | 1131 }), true); |
1132 res.get(arg_jobName, projectId: arg_projectId).then(unittest.expectAsync((
(api.TransferJob response) { | 1132 res.get(arg_jobName, projectId: arg_projectId).then(unittest.expectAsync1(
((api.TransferJob response) { |
1133 checkTransferJob(response); | 1133 checkTransferJob(response); |
1134 }))); | 1134 }))); |
1135 }); | 1135 }); |
1136 | 1136 |
1137 unittest.test("method--list", () { | 1137 unittest.test("method--list", () { |
1138 | 1138 |
1139 var mock = new HttpServerMock(); | 1139 var mock = new HttpServerMock(); |
1140 api.TransferJobsResourceApi res = new api.StoragetransferApi(mock).transfe
rJobs; | 1140 api.TransferJobsResourceApi res = new api.StoragetransferApi(mock).transfe
rJobs; |
1141 var arg_pageSize = 42; | 1141 var arg_pageSize = 42; |
1142 var arg_filter = "foo"; | 1142 var arg_filter = "foo"; |
1143 var arg_pageToken = "foo"; | 1143 var arg_pageToken = "foo"; |
1144 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1144 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1145 var path = (req.url).path; | 1145 var path = (req.url).path; |
1146 var pathOffset = 0; | 1146 var pathOffset = 0; |
1147 var index; | 1147 var index; |
1148 var subPart; | 1148 var subPart; |
1149 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1149 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1150 pathOffset += 1; | 1150 pathOffset += 1; |
1151 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("v1/transferJobs")); | 1151 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("v1/transferJobs")); |
1152 pathOffset += 15; | 1152 pathOffset += 15; |
1153 | 1153 |
1154 var query = (req.url).query; | 1154 var query = (req.url).query; |
(...skipping 16 matching lines...) Expand all Loading... |
1171 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1171 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
1172 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1172 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1173 | 1173 |
1174 | 1174 |
1175 var h = { | 1175 var h = { |
1176 "content-type" : "application/json; charset=utf-8", | 1176 "content-type" : "application/json; charset=utf-8", |
1177 }; | 1177 }; |
1178 var resp = convert.JSON.encode(buildListTransferJobsResponse()); | 1178 var resp = convert.JSON.encode(buildListTransferJobsResponse()); |
1179 return new async.Future.value(stringResponse(200, h, resp)); | 1179 return new async.Future.value(stringResponse(200, h, resp)); |
1180 }), true); | 1180 }), true); |
1181 res.list(pageSize: arg_pageSize, filter: arg_filter, pageToken: arg_pageTo
ken).then(unittest.expectAsync(((api.ListTransferJobsResponse response) { | 1181 res.list(pageSize: arg_pageSize, filter: arg_filter, pageToken: arg_pageTo
ken).then(unittest.expectAsync1(((api.ListTransferJobsResponse response) { |
1182 checkListTransferJobsResponse(response); | 1182 checkListTransferJobsResponse(response); |
1183 }))); | 1183 }))); |
1184 }); | 1184 }); |
1185 | 1185 |
1186 unittest.test("method--patch", () { | 1186 unittest.test("method--patch", () { |
1187 | 1187 |
1188 var mock = new HttpServerMock(); | 1188 var mock = new HttpServerMock(); |
1189 api.TransferJobsResourceApi res = new api.StoragetransferApi(mock).transfe
rJobs; | 1189 api.TransferJobsResourceApi res = new api.StoragetransferApi(mock).transfe
rJobs; |
1190 var arg_request = buildUpdateTransferJobRequest(); | 1190 var arg_request = buildUpdateTransferJobRequest(); |
1191 var arg_jobName = "foo"; | 1191 var arg_jobName = "foo"; |
1192 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1192 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1193 var obj = new api.UpdateTransferJobRequest.fromJson(json); | 1193 var obj = new api.UpdateTransferJobRequest.fromJson(json); |
1194 checkUpdateTransferJobRequest(obj); | 1194 checkUpdateTransferJobRequest(obj); |
1195 | 1195 |
1196 var path = (req.url).path; | 1196 var path = (req.url).path; |
1197 var pathOffset = 0; | 1197 var pathOffset = 0; |
1198 var index; | 1198 var index; |
1199 var subPart; | 1199 var subPart; |
1200 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1200 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1201 pathOffset += 1; | 1201 pathOffset += 1; |
1202 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1202 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1220 } | 1220 } |
1221 } | 1221 } |
1222 | 1222 |
1223 | 1223 |
1224 var h = { | 1224 var h = { |
1225 "content-type" : "application/json; charset=utf-8", | 1225 "content-type" : "application/json; charset=utf-8", |
1226 }; | 1226 }; |
1227 var resp = convert.JSON.encode(buildTransferJob()); | 1227 var resp = convert.JSON.encode(buildTransferJob()); |
1228 return new async.Future.value(stringResponse(200, h, resp)); | 1228 return new async.Future.value(stringResponse(200, h, resp)); |
1229 }), true); | 1229 }), true); |
1230 res.patch(arg_request, arg_jobName).then(unittest.expectAsync(((api.Transf
erJob response) { | 1230 res.patch(arg_request, arg_jobName).then(unittest.expectAsync1(((api.Trans
ferJob response) { |
1231 checkTransferJob(response); | 1231 checkTransferJob(response); |
1232 }))); | 1232 }))); |
1233 }); | 1233 }); |
1234 | 1234 |
1235 }); | 1235 }); |
1236 | 1236 |
1237 | 1237 |
1238 unittest.group("resource-TransferOperationsResourceApi", () { | 1238 unittest.group("resource-TransferOperationsResourceApi", () { |
1239 unittest.test("method--cancel", () { | 1239 unittest.test("method--cancel", () { |
1240 | 1240 |
1241 var mock = new HttpServerMock(); | 1241 var mock = new HttpServerMock(); |
1242 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; | 1242 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; |
1243 var arg_name = "foo"; | 1243 var arg_name = "foo"; |
1244 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1244 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1245 var path = (req.url).path; | 1245 var path = (req.url).path; |
1246 var pathOffset = 0; | 1246 var pathOffset = 0; |
1247 var index; | 1247 var index; |
1248 var subPart; | 1248 var subPart; |
1249 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1249 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1250 pathOffset += 1; | 1250 pathOffset += 1; |
1251 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1251 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
1252 pathOffset += 3; | 1252 pathOffset += 3; |
1253 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1253 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1254 | 1254 |
(...skipping 14 matching lines...) Expand all Loading... |
1269 } | 1269 } |
1270 } | 1270 } |
1271 | 1271 |
1272 | 1272 |
1273 var h = { | 1273 var h = { |
1274 "content-type" : "application/json; charset=utf-8", | 1274 "content-type" : "application/json; charset=utf-8", |
1275 }; | 1275 }; |
1276 var resp = convert.JSON.encode(buildEmpty()); | 1276 var resp = convert.JSON.encode(buildEmpty()); |
1277 return new async.Future.value(stringResponse(200, h, resp)); | 1277 return new async.Future.value(stringResponse(200, h, resp)); |
1278 }), true); | 1278 }), true); |
1279 res.cancel(arg_name).then(unittest.expectAsync(((api.Empty response) { | 1279 res.cancel(arg_name).then(unittest.expectAsync1(((api.Empty response) { |
1280 checkEmpty(response); | 1280 checkEmpty(response); |
1281 }))); | 1281 }))); |
1282 }); | 1282 }); |
1283 | 1283 |
1284 unittest.test("method--delete", () { | 1284 unittest.test("method--delete", () { |
1285 | 1285 |
1286 var mock = new HttpServerMock(); | 1286 var mock = new HttpServerMock(); |
1287 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; | 1287 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; |
1288 var arg_name = "foo"; | 1288 var arg_name = "foo"; |
1289 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1289 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1290 var path = (req.url).path; | 1290 var path = (req.url).path; |
1291 var pathOffset = 0; | 1291 var pathOffset = 0; |
1292 var index; | 1292 var index; |
1293 var subPart; | 1293 var subPart; |
1294 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1294 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1295 pathOffset += 1; | 1295 pathOffset += 1; |
1296 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1296 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
1297 pathOffset += 3; | 1297 pathOffset += 3; |
1298 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1298 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1299 | 1299 |
(...skipping 14 matching lines...) Expand all Loading... |
1314 } | 1314 } |
1315 } | 1315 } |
1316 | 1316 |
1317 | 1317 |
1318 var h = { | 1318 var h = { |
1319 "content-type" : "application/json; charset=utf-8", | 1319 "content-type" : "application/json; charset=utf-8", |
1320 }; | 1320 }; |
1321 var resp = convert.JSON.encode(buildEmpty()); | 1321 var resp = convert.JSON.encode(buildEmpty()); |
1322 return new async.Future.value(stringResponse(200, h, resp)); | 1322 return new async.Future.value(stringResponse(200, h, resp)); |
1323 }), true); | 1323 }), true); |
1324 res.delete(arg_name).then(unittest.expectAsync(((api.Empty response) { | 1324 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { |
1325 checkEmpty(response); | 1325 checkEmpty(response); |
1326 }))); | 1326 }))); |
1327 }); | 1327 }); |
1328 | 1328 |
1329 unittest.test("method--get", () { | 1329 unittest.test("method--get", () { |
1330 | 1330 |
1331 var mock = new HttpServerMock(); | 1331 var mock = new HttpServerMock(); |
1332 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; | 1332 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; |
1333 var arg_name = "foo"; | 1333 var arg_name = "foo"; |
1334 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1334 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1335 var path = (req.url).path; | 1335 var path = (req.url).path; |
1336 var pathOffset = 0; | 1336 var pathOffset = 0; |
1337 var index; | 1337 var index; |
1338 var subPart; | 1338 var subPart; |
1339 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1339 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1340 pathOffset += 1; | 1340 pathOffset += 1; |
1341 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1341 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
1342 pathOffset += 3; | 1342 pathOffset += 3; |
1343 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1343 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1344 | 1344 |
(...skipping 14 matching lines...) Expand all Loading... |
1359 } | 1359 } |
1360 } | 1360 } |
1361 | 1361 |
1362 | 1362 |
1363 var h = { | 1363 var h = { |
1364 "content-type" : "application/json; charset=utf-8", | 1364 "content-type" : "application/json; charset=utf-8", |
1365 }; | 1365 }; |
1366 var resp = convert.JSON.encode(buildOperation()); | 1366 var resp = convert.JSON.encode(buildOperation()); |
1367 return new async.Future.value(stringResponse(200, h, resp)); | 1367 return new async.Future.value(stringResponse(200, h, resp)); |
1368 }), true); | 1368 }), true); |
1369 res.get(arg_name).then(unittest.expectAsync(((api.Operation response) { | 1369 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) { |
1370 checkOperation(response); | 1370 checkOperation(response); |
1371 }))); | 1371 }))); |
1372 }); | 1372 }); |
1373 | 1373 |
1374 unittest.test("method--list", () { | 1374 unittest.test("method--list", () { |
1375 | 1375 |
1376 var mock = new HttpServerMock(); | 1376 var mock = new HttpServerMock(); |
1377 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; | 1377 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; |
1378 var arg_name = "foo"; | 1378 var arg_name = "foo"; |
| 1379 var arg_pageSize = 42; |
1379 var arg_filter = "foo"; | 1380 var arg_filter = "foo"; |
1380 var arg_pageToken = "foo"; | 1381 var arg_pageToken = "foo"; |
1381 var arg_pageSize = 42; | 1382 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1382 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1383 var path = (req.url).path; | 1383 var path = (req.url).path; |
1384 var pathOffset = 0; | 1384 var pathOffset = 0; |
1385 var index; | 1385 var index; |
1386 var subPart; | 1386 var subPart; |
1387 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1387 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1388 pathOffset += 1; | 1388 pathOffset += 1; |
1389 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1389 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
1390 pathOffset += 3; | 1390 pathOffset += 3; |
1391 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1391 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1392 | 1392 |
1393 var query = (req.url).query; | 1393 var query = (req.url).query; |
1394 var queryOffset = 0; | 1394 var queryOffset = 0; |
1395 var queryMap = {}; | 1395 var queryMap = {}; |
1396 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1396 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1397 parseBool(n) { | 1397 parseBool(n) { |
1398 if (n == "true") return true; | 1398 if (n == "true") return true; |
1399 if (n == "false") return false; | 1399 if (n == "false") return false; |
1400 if (n == null) return null; | 1400 if (n == null) return null; |
1401 throw new core.ArgumentError("Invalid boolean: $n"); | 1401 throw new core.ArgumentError("Invalid boolean: $n"); |
1402 } | 1402 } |
1403 if (query.length > 0) { | 1403 if (query.length > 0) { |
1404 for (var part in query.split("&")) { | 1404 for (var part in query.split("&")) { |
1405 var keyvalue = part.split("="); | 1405 var keyvalue = part.split("="); |
1406 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1406 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1407 } | 1407 } |
1408 } | 1408 } |
| 1409 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1409 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1410 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
1410 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1411 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1411 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
1412 | 1412 |
1413 | 1413 |
1414 var h = { | 1414 var h = { |
1415 "content-type" : "application/json; charset=utf-8", | 1415 "content-type" : "application/json; charset=utf-8", |
1416 }; | 1416 }; |
1417 var resp = convert.JSON.encode(buildListOperationsResponse()); | 1417 var resp = convert.JSON.encode(buildListOperationsResponse()); |
1418 return new async.Future.value(stringResponse(200, h, resp)); | 1418 return new async.Future.value(stringResponse(200, h, resp)); |
1419 }), true); | 1419 }), true); |
1420 res.list(arg_name, filter: arg_filter, pageToken: arg_pageToken, pageSize:
arg_pageSize).then(unittest.expectAsync(((api.ListOperationsResponse response)
{ | 1420 res.list(arg_name, pageSize: arg_pageSize, filter: arg_filter, pageToken:
arg_pageToken).then(unittest.expectAsync1(((api.ListOperationsResponse response)
{ |
1421 checkListOperationsResponse(response); | 1421 checkListOperationsResponse(response); |
1422 }))); | 1422 }))); |
1423 }); | 1423 }); |
1424 | 1424 |
1425 unittest.test("method--pause", () { | 1425 unittest.test("method--pause", () { |
1426 | 1426 |
1427 var mock = new HttpServerMock(); | 1427 var mock = new HttpServerMock(); |
1428 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; | 1428 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; |
1429 var arg_request = buildPauseTransferOperationRequest(); | 1429 var arg_request = buildPauseTransferOperationRequest(); |
1430 var arg_name = "foo"; | 1430 var arg_name = "foo"; |
1431 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1431 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1432 var obj = new api.PauseTransferOperationRequest.fromJson(json); | 1432 var obj = new api.PauseTransferOperationRequest.fromJson(json); |
1433 checkPauseTransferOperationRequest(obj); | 1433 checkPauseTransferOperationRequest(obj); |
1434 | 1434 |
1435 var path = (req.url).path; | 1435 var path = (req.url).path; |
1436 var pathOffset = 0; | 1436 var pathOffset = 0; |
1437 var index; | 1437 var index; |
1438 var subPart; | 1438 var subPart; |
1439 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1439 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1440 pathOffset += 1; | 1440 pathOffset += 1; |
1441 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1441 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1459 } | 1459 } |
1460 } | 1460 } |
1461 | 1461 |
1462 | 1462 |
1463 var h = { | 1463 var h = { |
1464 "content-type" : "application/json; charset=utf-8", | 1464 "content-type" : "application/json; charset=utf-8", |
1465 }; | 1465 }; |
1466 var resp = convert.JSON.encode(buildEmpty()); | 1466 var resp = convert.JSON.encode(buildEmpty()); |
1467 return new async.Future.value(stringResponse(200, h, resp)); | 1467 return new async.Future.value(stringResponse(200, h, resp)); |
1468 }), true); | 1468 }), true); |
1469 res.pause(arg_request, arg_name).then(unittest.expectAsync(((api.Empty res
ponse) { | 1469 res.pause(arg_request, arg_name).then(unittest.expectAsync1(((api.Empty re
sponse) { |
1470 checkEmpty(response); | 1470 checkEmpty(response); |
1471 }))); | 1471 }))); |
1472 }); | 1472 }); |
1473 | 1473 |
1474 unittest.test("method--resume", () { | 1474 unittest.test("method--resume", () { |
1475 | 1475 |
1476 var mock = new HttpServerMock(); | 1476 var mock = new HttpServerMock(); |
1477 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; | 1477 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; |
1478 var arg_request = buildResumeTransferOperationRequest(); | 1478 var arg_request = buildResumeTransferOperationRequest(); |
1479 var arg_name = "foo"; | 1479 var arg_name = "foo"; |
1480 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1480 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1481 var obj = new api.ResumeTransferOperationRequest.fromJson(json); | 1481 var obj = new api.ResumeTransferOperationRequest.fromJson(json); |
1482 checkResumeTransferOperationRequest(obj); | 1482 checkResumeTransferOperationRequest(obj); |
1483 | 1483 |
1484 var path = (req.url).path; | 1484 var path = (req.url).path; |
1485 var pathOffset = 0; | 1485 var pathOffset = 0; |
1486 var index; | 1486 var index; |
1487 var subPart; | 1487 var subPart; |
1488 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1488 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1489 pathOffset += 1; | 1489 pathOffset += 1; |
1490 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1490 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1508 } | 1508 } |
1509 } | 1509 } |
1510 | 1510 |
1511 | 1511 |
1512 var h = { | 1512 var h = { |
1513 "content-type" : "application/json; charset=utf-8", | 1513 "content-type" : "application/json; charset=utf-8", |
1514 }; | 1514 }; |
1515 var resp = convert.JSON.encode(buildEmpty()); | 1515 var resp = convert.JSON.encode(buildEmpty()); |
1516 return new async.Future.value(stringResponse(200, h, resp)); | 1516 return new async.Future.value(stringResponse(200, h, resp)); |
1517 }), true); | 1517 }), true); |
1518 res.resume(arg_request, arg_name).then(unittest.expectAsync(((api.Empty re
sponse) { | 1518 res.resume(arg_request, arg_name).then(unittest.expectAsync1(((api.Empty r
esponse) { |
1519 checkEmpty(response); | 1519 checkEmpty(response); |
1520 }))); | 1520 }))); |
1521 }); | 1521 }); |
1522 | 1522 |
1523 }); | 1523 }); |
1524 | 1524 |
1525 | 1525 |
1526 } | 1526 } |
1527 | 1527 |
OLD | NEW |