| OLD | NEW |
| 1 library googleapis.storage.v1.test; | 1 library googleapis.storage.v1.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
| 11 import 'package:googleapis/common/common.dart' as common; | |
| 12 import 'package:googleapis/src/common_internal.dart' as common_internal; | |
| 13 import '../common/common_internal_test.dart' as common_test; | |
| 14 | 11 |
| 15 import 'package:googleapis/storage/v1.dart' as api; | 12 import 'package:googleapis/storage/v1.dart' as api; |
| 16 | 13 |
| 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; |
| 16 core.bool _expectJson; |
| 17 | 17 |
| 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; |
| 20 _expectJson = expectJson; |
| 21 } |
| 18 | 22 |
| 19 buildUnnamed790() { | 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { |
| 25 return request.finalize() |
| 26 .transform(convert.UTF8.decoder) |
| 27 .join('') |
| 28 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); |
| 31 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } |
| 34 }); |
| 35 } else { |
| 36 var stream = request.finalize(); |
| 37 if (stream == null) { |
| 38 return _callback(request, []); |
| 39 } else { |
| 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); |
| 42 }); |
| 43 } |
| 44 } |
| 45 } |
| 46 } |
| 47 |
| 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } |
| 53 |
| 54 buildUnnamed1329() { |
| 20 var o = new core.List<api.BucketAccessControl>(); | 55 var o = new core.List<api.BucketAccessControl>(); |
| 21 o.add(buildBucketAccessControl()); | 56 o.add(buildBucketAccessControl()); |
| 22 o.add(buildBucketAccessControl()); | 57 o.add(buildBucketAccessControl()); |
| 23 return o; | 58 return o; |
| 24 } | 59 } |
| 25 | 60 |
| 26 checkUnnamed790(core.List<api.BucketAccessControl> o) { | 61 checkUnnamed1329(core.List<api.BucketAccessControl> o) { |
| 27 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
| 28 checkBucketAccessControl(o[0]); | 63 checkBucketAccessControl(o[0]); |
| 29 checkBucketAccessControl(o[1]); | 64 checkBucketAccessControl(o[1]); |
| 30 } | 65 } |
| 31 | 66 |
| 32 buildUnnamed791() { | 67 buildUnnamed1330() { |
| 33 var o = new core.List<core.String>(); | 68 var o = new core.List<core.String>(); |
| 34 o.add("foo"); | 69 o.add("foo"); |
| 35 o.add("foo"); | 70 o.add("foo"); |
| 36 return o; | 71 return o; |
| 37 } | 72 } |
| 38 | 73 |
| 39 checkUnnamed791(core.List<core.String> o) { | 74 checkUnnamed1330(core.List<core.String> o) { |
| 40 unittest.expect(o, unittest.hasLength(2)); | 75 unittest.expect(o, unittest.hasLength(2)); |
| 41 unittest.expect(o[0], unittest.equals('foo')); | 76 unittest.expect(o[0], unittest.equals('foo')); |
| 42 unittest.expect(o[1], unittest.equals('foo')); | 77 unittest.expect(o[1], unittest.equals('foo')); |
| 43 } | 78 } |
| 44 | 79 |
| 45 buildUnnamed792() { | 80 buildUnnamed1331() { |
| 46 var o = new core.List<core.String>(); | 81 var o = new core.List<core.String>(); |
| 47 o.add("foo"); | 82 o.add("foo"); |
| 48 o.add("foo"); | 83 o.add("foo"); |
| 49 return o; | 84 return o; |
| 50 } | 85 } |
| 51 | 86 |
| 52 checkUnnamed792(core.List<core.String> o) { | 87 checkUnnamed1331(core.List<core.String> o) { |
| 53 unittest.expect(o, unittest.hasLength(2)); | 88 unittest.expect(o, unittest.hasLength(2)); |
| 54 unittest.expect(o[0], unittest.equals('foo')); | 89 unittest.expect(o[0], unittest.equals('foo')); |
| 55 unittest.expect(o[1], unittest.equals('foo')); | 90 unittest.expect(o[1], unittest.equals('foo')); |
| 56 } | 91 } |
| 57 | 92 |
| 58 buildUnnamed793() { | 93 buildUnnamed1332() { |
| 59 var o = new core.List<core.String>(); | 94 var o = new core.List<core.String>(); |
| 60 o.add("foo"); | 95 o.add("foo"); |
| 61 o.add("foo"); | 96 o.add("foo"); |
| 62 return o; | 97 return o; |
| 63 } | 98 } |
| 64 | 99 |
| 65 checkUnnamed793(core.List<core.String> o) { | 100 checkUnnamed1332(core.List<core.String> o) { |
| 66 unittest.expect(o, unittest.hasLength(2)); | 101 unittest.expect(o, unittest.hasLength(2)); |
| 67 unittest.expect(o[0], unittest.equals('foo')); | 102 unittest.expect(o[0], unittest.equals('foo')); |
| 68 unittest.expect(o[1], unittest.equals('foo')); | 103 unittest.expect(o[1], unittest.equals('foo')); |
| 69 } | 104 } |
| 70 | 105 |
| 71 core.int buildCounterBucketCors = 0; | 106 core.int buildCounterBucketCors = 0; |
| 72 buildBucketCors() { | 107 buildBucketCors() { |
| 73 var o = new api.BucketCors(); | 108 var o = new api.BucketCors(); |
| 74 buildCounterBucketCors++; | 109 buildCounterBucketCors++; |
| 75 if (buildCounterBucketCors < 3) { | 110 if (buildCounterBucketCors < 3) { |
| 76 o.maxAgeSeconds = 42; | 111 o.maxAgeSeconds = 42; |
| 77 o.method = buildUnnamed791(); | 112 o.method = buildUnnamed1330(); |
| 78 o.origin = buildUnnamed792(); | 113 o.origin = buildUnnamed1331(); |
| 79 o.responseHeader = buildUnnamed793(); | 114 o.responseHeader = buildUnnamed1332(); |
| 80 } | 115 } |
| 81 buildCounterBucketCors--; | 116 buildCounterBucketCors--; |
| 82 return o; | 117 return o; |
| 83 } | 118 } |
| 84 | 119 |
| 85 checkBucketCors(api.BucketCors o) { | 120 checkBucketCors(api.BucketCors o) { |
| 86 buildCounterBucketCors++; | 121 buildCounterBucketCors++; |
| 87 if (buildCounterBucketCors < 3) { | 122 if (buildCounterBucketCors < 3) { |
| 88 unittest.expect(o.maxAgeSeconds, unittest.equals(42)); | 123 unittest.expect(o.maxAgeSeconds, unittest.equals(42)); |
| 89 checkUnnamed791(o.method); | 124 checkUnnamed1330(o.method); |
| 90 checkUnnamed792(o.origin); | 125 checkUnnamed1331(o.origin); |
| 91 checkUnnamed793(o.responseHeader); | 126 checkUnnamed1332(o.responseHeader); |
| 92 } | 127 } |
| 93 buildCounterBucketCors--; | 128 buildCounterBucketCors--; |
| 94 } | 129 } |
| 95 | 130 |
| 96 buildUnnamed794() { | 131 buildUnnamed1333() { |
| 97 var o = new core.List<api.BucketCors>(); | 132 var o = new core.List<api.BucketCors>(); |
| 98 o.add(buildBucketCors()); | 133 o.add(buildBucketCors()); |
| 99 o.add(buildBucketCors()); | 134 o.add(buildBucketCors()); |
| 100 return o; | 135 return o; |
| 101 } | 136 } |
| 102 | 137 |
| 103 checkUnnamed794(core.List<api.BucketCors> o) { | 138 checkUnnamed1333(core.List<api.BucketCors> o) { |
| 104 unittest.expect(o, unittest.hasLength(2)); | 139 unittest.expect(o, unittest.hasLength(2)); |
| 105 checkBucketCors(o[0]); | 140 checkBucketCors(o[0]); |
| 106 checkBucketCors(o[1]); | 141 checkBucketCors(o[1]); |
| 107 } | 142 } |
| 108 | 143 |
| 109 buildUnnamed795() { | 144 buildUnnamed1334() { |
| 110 var o = new core.List<api.ObjectAccessControl>(); | 145 var o = new core.List<api.ObjectAccessControl>(); |
| 111 o.add(buildObjectAccessControl()); | 146 o.add(buildObjectAccessControl()); |
| 112 o.add(buildObjectAccessControl()); | 147 o.add(buildObjectAccessControl()); |
| 113 return o; | 148 return o; |
| 114 } | 149 } |
| 115 | 150 |
| 116 checkUnnamed795(core.List<api.ObjectAccessControl> o) { | 151 checkUnnamed1334(core.List<api.ObjectAccessControl> o) { |
| 117 unittest.expect(o, unittest.hasLength(2)); | 152 unittest.expect(o, unittest.hasLength(2)); |
| 118 checkObjectAccessControl(o[0]); | 153 checkObjectAccessControl(o[0]); |
| 119 checkObjectAccessControl(o[1]); | 154 checkObjectAccessControl(o[1]); |
| 120 } | 155 } |
| 121 | 156 |
| 122 core.int buildCounterBucketLifecycleRuleAction = 0; | 157 core.int buildCounterBucketLifecycleRuleAction = 0; |
| 123 buildBucketLifecycleRuleAction() { | 158 buildBucketLifecycleRuleAction() { |
| 124 var o = new api.BucketLifecycleRuleAction(); | 159 var o = new api.BucketLifecycleRuleAction(); |
| 125 buildCounterBucketLifecycleRuleAction++; | 160 buildCounterBucketLifecycleRuleAction++; |
| 126 if (buildCounterBucketLifecycleRuleAction < 3) { | 161 if (buildCounterBucketLifecycleRuleAction < 3) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 212 |
| 178 checkBucketLifecycleRule(api.BucketLifecycleRule o) { | 213 checkBucketLifecycleRule(api.BucketLifecycleRule o) { |
| 179 buildCounterBucketLifecycleRule++; | 214 buildCounterBucketLifecycleRule++; |
| 180 if (buildCounterBucketLifecycleRule < 3) { | 215 if (buildCounterBucketLifecycleRule < 3) { |
| 181 checkBucketLifecycleRuleAction(o.action); | 216 checkBucketLifecycleRuleAction(o.action); |
| 182 checkBucketLifecycleRuleCondition(o.condition); | 217 checkBucketLifecycleRuleCondition(o.condition); |
| 183 } | 218 } |
| 184 buildCounterBucketLifecycleRule--; | 219 buildCounterBucketLifecycleRule--; |
| 185 } | 220 } |
| 186 | 221 |
| 187 buildUnnamed796() { | 222 buildUnnamed1335() { |
| 188 var o = new core.List<api.BucketLifecycleRule>(); | 223 var o = new core.List<api.BucketLifecycleRule>(); |
| 189 o.add(buildBucketLifecycleRule()); | 224 o.add(buildBucketLifecycleRule()); |
| 190 o.add(buildBucketLifecycleRule()); | 225 o.add(buildBucketLifecycleRule()); |
| 191 return o; | 226 return o; |
| 192 } | 227 } |
| 193 | 228 |
| 194 checkUnnamed796(core.List<api.BucketLifecycleRule> o) { | 229 checkUnnamed1335(core.List<api.BucketLifecycleRule> o) { |
| 195 unittest.expect(o, unittest.hasLength(2)); | 230 unittest.expect(o, unittest.hasLength(2)); |
| 196 checkBucketLifecycleRule(o[0]); | 231 checkBucketLifecycleRule(o[0]); |
| 197 checkBucketLifecycleRule(o[1]); | 232 checkBucketLifecycleRule(o[1]); |
| 198 } | 233 } |
| 199 | 234 |
| 200 core.int buildCounterBucketLifecycle = 0; | 235 core.int buildCounterBucketLifecycle = 0; |
| 201 buildBucketLifecycle() { | 236 buildBucketLifecycle() { |
| 202 var o = new api.BucketLifecycle(); | 237 var o = new api.BucketLifecycle(); |
| 203 buildCounterBucketLifecycle++; | 238 buildCounterBucketLifecycle++; |
| 204 if (buildCounterBucketLifecycle < 3) { | 239 if (buildCounterBucketLifecycle < 3) { |
| 205 o.rule = buildUnnamed796(); | 240 o.rule = buildUnnamed1335(); |
| 206 } | 241 } |
| 207 buildCounterBucketLifecycle--; | 242 buildCounterBucketLifecycle--; |
| 208 return o; | 243 return o; |
| 209 } | 244 } |
| 210 | 245 |
| 211 checkBucketLifecycle(api.BucketLifecycle o) { | 246 checkBucketLifecycle(api.BucketLifecycle o) { |
| 212 buildCounterBucketLifecycle++; | 247 buildCounterBucketLifecycle++; |
| 213 if (buildCounterBucketLifecycle < 3) { | 248 if (buildCounterBucketLifecycle < 3) { |
| 214 checkUnnamed796(o.rule); | 249 checkUnnamed1335(o.rule); |
| 215 } | 250 } |
| 216 buildCounterBucketLifecycle--; | 251 buildCounterBucketLifecycle--; |
| 217 } | 252 } |
| 218 | 253 |
| 219 core.int buildCounterBucketLogging = 0; | 254 core.int buildCounterBucketLogging = 0; |
| 220 buildBucketLogging() { | 255 buildBucketLogging() { |
| 221 var o = new api.BucketLogging(); | 256 var o = new api.BucketLogging(); |
| 222 buildCounterBucketLogging++; | 257 buildCounterBucketLogging++; |
| 223 if (buildCounterBucketLogging < 3) { | 258 if (buildCounterBucketLogging < 3) { |
| 224 o.logBucket = "foo"; | 259 o.logBucket = "foo"; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 unittest.expect(o.notFoundPage, unittest.equals('foo')); | 331 unittest.expect(o.notFoundPage, unittest.equals('foo')); |
| 297 } | 332 } |
| 298 buildCounterBucketWebsite--; | 333 buildCounterBucketWebsite--; |
| 299 } | 334 } |
| 300 | 335 |
| 301 core.int buildCounterBucket = 0; | 336 core.int buildCounterBucket = 0; |
| 302 buildBucket() { | 337 buildBucket() { |
| 303 var o = new api.Bucket(); | 338 var o = new api.Bucket(); |
| 304 buildCounterBucket++; | 339 buildCounterBucket++; |
| 305 if (buildCounterBucket < 3) { | 340 if (buildCounterBucket < 3) { |
| 306 o.acl = buildUnnamed790(); | 341 o.acl = buildUnnamed1329(); |
| 307 o.cors = buildUnnamed794(); | 342 o.cors = buildUnnamed1333(); |
| 308 o.defaultObjectAcl = buildUnnamed795(); | 343 o.defaultObjectAcl = buildUnnamed1334(); |
| 309 o.etag = "foo"; | 344 o.etag = "foo"; |
| 310 o.id = "foo"; | 345 o.id = "foo"; |
| 311 o.kind = "foo"; | 346 o.kind = "foo"; |
| 312 o.lifecycle = buildBucketLifecycle(); | 347 o.lifecycle = buildBucketLifecycle(); |
| 313 o.location = "foo"; | 348 o.location = "foo"; |
| 314 o.logging = buildBucketLogging(); | 349 o.logging = buildBucketLogging(); |
| 315 o.metageneration = "foo"; | 350 o.metageneration = "foo"; |
| 316 o.name = "foo"; | 351 o.name = "foo"; |
| 317 o.owner = buildBucketOwner(); | 352 o.owner = buildBucketOwner(); |
| 318 o.projectNumber = "foo"; | 353 o.projectNumber = "foo"; |
| 319 o.selfLink = "foo"; | 354 o.selfLink = "foo"; |
| 320 o.storageClass = "foo"; | 355 o.storageClass = "foo"; |
| 321 o.timeCreated = core.DateTime.parse("2002-02-27T14:01:02"); | 356 o.timeCreated = core.DateTime.parse("2002-02-27T14:01:02"); |
| 322 o.versioning = buildBucketVersioning(); | 357 o.versioning = buildBucketVersioning(); |
| 323 o.website = buildBucketWebsite(); | 358 o.website = buildBucketWebsite(); |
| 324 } | 359 } |
| 325 buildCounterBucket--; | 360 buildCounterBucket--; |
| 326 return o; | 361 return o; |
| 327 } | 362 } |
| 328 | 363 |
| 329 checkBucket(api.Bucket o) { | 364 checkBucket(api.Bucket o) { |
| 330 buildCounterBucket++; | 365 buildCounterBucket++; |
| 331 if (buildCounterBucket < 3) { | 366 if (buildCounterBucket < 3) { |
| 332 checkUnnamed790(o.acl); | 367 checkUnnamed1329(o.acl); |
| 333 checkUnnamed794(o.cors); | 368 checkUnnamed1333(o.cors); |
| 334 checkUnnamed795(o.defaultObjectAcl); | 369 checkUnnamed1334(o.defaultObjectAcl); |
| 335 unittest.expect(o.etag, unittest.equals('foo')); | 370 unittest.expect(o.etag, unittest.equals('foo')); |
| 336 unittest.expect(o.id, unittest.equals('foo')); | 371 unittest.expect(o.id, unittest.equals('foo')); |
| 337 unittest.expect(o.kind, unittest.equals('foo')); | 372 unittest.expect(o.kind, unittest.equals('foo')); |
| 338 checkBucketLifecycle(o.lifecycle); | 373 checkBucketLifecycle(o.lifecycle); |
| 339 unittest.expect(o.location, unittest.equals('foo')); | 374 unittest.expect(o.location, unittest.equals('foo')); |
| 340 checkBucketLogging(o.logging); | 375 checkBucketLogging(o.logging); |
| 341 unittest.expect(o.metageneration, unittest.equals('foo')); | 376 unittest.expect(o.metageneration, unittest.equals('foo')); |
| 342 unittest.expect(o.name, unittest.equals('foo')); | 377 unittest.expect(o.name, unittest.equals('foo')); |
| 343 checkBucketOwner(o.owner); | 378 checkBucketOwner(o.owner); |
| 344 unittest.expect(o.projectNumber, unittest.equals('foo')); | 379 unittest.expect(o.projectNumber, unittest.equals('foo')); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 unittest.expect(o.etag, unittest.equals('foo')); | 439 unittest.expect(o.etag, unittest.equals('foo')); |
| 405 unittest.expect(o.id, unittest.equals('foo')); | 440 unittest.expect(o.id, unittest.equals('foo')); |
| 406 unittest.expect(o.kind, unittest.equals('foo')); | 441 unittest.expect(o.kind, unittest.equals('foo')); |
| 407 checkBucketAccessControlProjectTeam(o.projectTeam); | 442 checkBucketAccessControlProjectTeam(o.projectTeam); |
| 408 unittest.expect(o.role, unittest.equals('foo')); | 443 unittest.expect(o.role, unittest.equals('foo')); |
| 409 unittest.expect(o.selfLink, unittest.equals('foo')); | 444 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 410 } | 445 } |
| 411 buildCounterBucketAccessControl--; | 446 buildCounterBucketAccessControl--; |
| 412 } | 447 } |
| 413 | 448 |
| 414 buildUnnamed797() { | 449 buildUnnamed1336() { |
| 415 var o = new core.List<api.BucketAccessControl>(); | 450 var o = new core.List<api.BucketAccessControl>(); |
| 416 o.add(buildBucketAccessControl()); | 451 o.add(buildBucketAccessControl()); |
| 417 o.add(buildBucketAccessControl()); | 452 o.add(buildBucketAccessControl()); |
| 418 return o; | 453 return o; |
| 419 } | 454 } |
| 420 | 455 |
| 421 checkUnnamed797(core.List<api.BucketAccessControl> o) { | 456 checkUnnamed1336(core.List<api.BucketAccessControl> o) { |
| 422 unittest.expect(o, unittest.hasLength(2)); | 457 unittest.expect(o, unittest.hasLength(2)); |
| 423 checkBucketAccessControl(o[0]); | 458 checkBucketAccessControl(o[0]); |
| 424 checkBucketAccessControl(o[1]); | 459 checkBucketAccessControl(o[1]); |
| 425 } | 460 } |
| 426 | 461 |
| 427 core.int buildCounterBucketAccessControls = 0; | 462 core.int buildCounterBucketAccessControls = 0; |
| 428 buildBucketAccessControls() { | 463 buildBucketAccessControls() { |
| 429 var o = new api.BucketAccessControls(); | 464 var o = new api.BucketAccessControls(); |
| 430 buildCounterBucketAccessControls++; | 465 buildCounterBucketAccessControls++; |
| 431 if (buildCounterBucketAccessControls < 3) { | 466 if (buildCounterBucketAccessControls < 3) { |
| 432 o.items = buildUnnamed797(); | 467 o.items = buildUnnamed1336(); |
| 433 o.kind = "foo"; | 468 o.kind = "foo"; |
| 434 } | 469 } |
| 435 buildCounterBucketAccessControls--; | 470 buildCounterBucketAccessControls--; |
| 436 return o; | 471 return o; |
| 437 } | 472 } |
| 438 | 473 |
| 439 checkBucketAccessControls(api.BucketAccessControls o) { | 474 checkBucketAccessControls(api.BucketAccessControls o) { |
| 440 buildCounterBucketAccessControls++; | 475 buildCounterBucketAccessControls++; |
| 441 if (buildCounterBucketAccessControls < 3) { | 476 if (buildCounterBucketAccessControls < 3) { |
| 442 checkUnnamed797(o.items); | 477 checkUnnamed1336(o.items); |
| 443 unittest.expect(o.kind, unittest.equals('foo')); | 478 unittest.expect(o.kind, unittest.equals('foo')); |
| 444 } | 479 } |
| 445 buildCounterBucketAccessControls--; | 480 buildCounterBucketAccessControls--; |
| 446 } | 481 } |
| 447 | 482 |
| 448 buildUnnamed798() { | 483 buildUnnamed1337() { |
| 449 var o = new core.List<api.Bucket>(); | 484 var o = new core.List<api.Bucket>(); |
| 450 o.add(buildBucket()); | 485 o.add(buildBucket()); |
| 451 o.add(buildBucket()); | 486 o.add(buildBucket()); |
| 452 return o; | 487 return o; |
| 453 } | 488 } |
| 454 | 489 |
| 455 checkUnnamed798(core.List<api.Bucket> o) { | 490 checkUnnamed1337(core.List<api.Bucket> o) { |
| 456 unittest.expect(o, unittest.hasLength(2)); | 491 unittest.expect(o, unittest.hasLength(2)); |
| 457 checkBucket(o[0]); | 492 checkBucket(o[0]); |
| 458 checkBucket(o[1]); | 493 checkBucket(o[1]); |
| 459 } | 494 } |
| 460 | 495 |
| 461 core.int buildCounterBuckets = 0; | 496 core.int buildCounterBuckets = 0; |
| 462 buildBuckets() { | 497 buildBuckets() { |
| 463 var o = new api.Buckets(); | 498 var o = new api.Buckets(); |
| 464 buildCounterBuckets++; | 499 buildCounterBuckets++; |
| 465 if (buildCounterBuckets < 3) { | 500 if (buildCounterBuckets < 3) { |
| 466 o.items = buildUnnamed798(); | 501 o.items = buildUnnamed1337(); |
| 467 o.kind = "foo"; | 502 o.kind = "foo"; |
| 468 o.nextPageToken = "foo"; | 503 o.nextPageToken = "foo"; |
| 469 } | 504 } |
| 470 buildCounterBuckets--; | 505 buildCounterBuckets--; |
| 471 return o; | 506 return o; |
| 472 } | 507 } |
| 473 | 508 |
| 474 checkBuckets(api.Buckets o) { | 509 checkBuckets(api.Buckets o) { |
| 475 buildCounterBuckets++; | 510 buildCounterBuckets++; |
| 476 if (buildCounterBuckets < 3) { | 511 if (buildCounterBuckets < 3) { |
| 477 checkUnnamed798(o.items); | 512 checkUnnamed1337(o.items); |
| 478 unittest.expect(o.kind, unittest.equals('foo')); | 513 unittest.expect(o.kind, unittest.equals('foo')); |
| 479 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 514 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 480 } | 515 } |
| 481 buildCounterBuckets--; | 516 buildCounterBuckets--; |
| 482 } | 517 } |
| 483 | 518 |
| 484 buildUnnamed799() { | 519 buildUnnamed1338() { |
| 485 var o = new core.Map<core.String, core.String>(); | 520 var o = new core.Map<core.String, core.String>(); |
| 486 o["x"] = "foo"; | 521 o["x"] = "foo"; |
| 487 o["y"] = "foo"; | 522 o["y"] = "foo"; |
| 488 return o; | 523 return o; |
| 489 } | 524 } |
| 490 | 525 |
| 491 checkUnnamed799(core.Map<core.String, core.String> o) { | 526 checkUnnamed1338(core.Map<core.String, core.String> o) { |
| 492 unittest.expect(o, unittest.hasLength(2)); | 527 unittest.expect(o, unittest.hasLength(2)); |
| 493 unittest.expect(o["x"], unittest.equals('foo')); | 528 unittest.expect(o["x"], unittest.equals('foo')); |
| 494 unittest.expect(o["y"], unittest.equals('foo')); | 529 unittest.expect(o["y"], unittest.equals('foo')); |
| 495 } | 530 } |
| 496 | 531 |
| 497 core.int buildCounterChannel = 0; | 532 core.int buildCounterChannel = 0; |
| 498 buildChannel() { | 533 buildChannel() { |
| 499 var o = new api.Channel(); | 534 var o = new api.Channel(); |
| 500 buildCounterChannel++; | 535 buildCounterChannel++; |
| 501 if (buildCounterChannel < 3) { | 536 if (buildCounterChannel < 3) { |
| 502 o.address = "foo"; | 537 o.address = "foo"; |
| 503 o.expiration = "foo"; | 538 o.expiration = "foo"; |
| 504 o.id = "foo"; | 539 o.id = "foo"; |
| 505 o.kind = "foo"; | 540 o.kind = "foo"; |
| 506 o.params = buildUnnamed799(); | 541 o.params = buildUnnamed1338(); |
| 507 o.payload = true; | 542 o.payload = true; |
| 508 o.resourceId = "foo"; | 543 o.resourceId = "foo"; |
| 509 o.resourceUri = "foo"; | 544 o.resourceUri = "foo"; |
| 510 o.token = "foo"; | 545 o.token = "foo"; |
| 511 o.type = "foo"; | 546 o.type = "foo"; |
| 512 } | 547 } |
| 513 buildCounterChannel--; | 548 buildCounterChannel--; |
| 514 return o; | 549 return o; |
| 515 } | 550 } |
| 516 | 551 |
| 517 checkChannel(api.Channel o) { | 552 checkChannel(api.Channel o) { |
| 518 buildCounterChannel++; | 553 buildCounterChannel++; |
| 519 if (buildCounterChannel < 3) { | 554 if (buildCounterChannel < 3) { |
| 520 unittest.expect(o.address, unittest.equals('foo')); | 555 unittest.expect(o.address, unittest.equals('foo')); |
| 521 unittest.expect(o.expiration, unittest.equals('foo')); | 556 unittest.expect(o.expiration, unittest.equals('foo')); |
| 522 unittest.expect(o.id, unittest.equals('foo')); | 557 unittest.expect(o.id, unittest.equals('foo')); |
| 523 unittest.expect(o.kind, unittest.equals('foo')); | 558 unittest.expect(o.kind, unittest.equals('foo')); |
| 524 checkUnnamed799(o.params); | 559 checkUnnamed1338(o.params); |
| 525 unittest.expect(o.payload, unittest.isTrue); | 560 unittest.expect(o.payload, unittest.isTrue); |
| 526 unittest.expect(o.resourceId, unittest.equals('foo')); | 561 unittest.expect(o.resourceId, unittest.equals('foo')); |
| 527 unittest.expect(o.resourceUri, unittest.equals('foo')); | 562 unittest.expect(o.resourceUri, unittest.equals('foo')); |
| 528 unittest.expect(o.token, unittest.equals('foo')); | 563 unittest.expect(o.token, unittest.equals('foo')); |
| 529 unittest.expect(o.type, unittest.equals('foo')); | 564 unittest.expect(o.type, unittest.equals('foo')); |
| 530 } | 565 } |
| 531 buildCounterChannel--; | 566 buildCounterChannel--; |
| 532 } | 567 } |
| 533 | 568 |
| 534 core.int buildCounterComposeRequestSourceObjectsObjectPreconditions = 0; | 569 core.int buildCounterComposeRequestSourceObjectsObjectPreconditions = 0; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 checkComposeRequestSourceObjects(api.ComposeRequestSourceObjects o) { | 601 checkComposeRequestSourceObjects(api.ComposeRequestSourceObjects o) { |
| 567 buildCounterComposeRequestSourceObjects++; | 602 buildCounterComposeRequestSourceObjects++; |
| 568 if (buildCounterComposeRequestSourceObjects < 3) { | 603 if (buildCounterComposeRequestSourceObjects < 3) { |
| 569 unittest.expect(o.generation, unittest.equals('foo')); | 604 unittest.expect(o.generation, unittest.equals('foo')); |
| 570 unittest.expect(o.name, unittest.equals('foo')); | 605 unittest.expect(o.name, unittest.equals('foo')); |
| 571 checkComposeRequestSourceObjectsObjectPreconditions(o.objectPreconditions); | 606 checkComposeRequestSourceObjectsObjectPreconditions(o.objectPreconditions); |
| 572 } | 607 } |
| 573 buildCounterComposeRequestSourceObjects--; | 608 buildCounterComposeRequestSourceObjects--; |
| 574 } | 609 } |
| 575 | 610 |
| 576 buildUnnamed800() { | 611 buildUnnamed1339() { |
| 577 var o = new core.List<api.ComposeRequestSourceObjects>(); | 612 var o = new core.List<api.ComposeRequestSourceObjects>(); |
| 578 o.add(buildComposeRequestSourceObjects()); | 613 o.add(buildComposeRequestSourceObjects()); |
| 579 o.add(buildComposeRequestSourceObjects()); | 614 o.add(buildComposeRequestSourceObjects()); |
| 580 return o; | 615 return o; |
| 581 } | 616 } |
| 582 | 617 |
| 583 checkUnnamed800(core.List<api.ComposeRequestSourceObjects> o) { | 618 checkUnnamed1339(core.List<api.ComposeRequestSourceObjects> o) { |
| 584 unittest.expect(o, unittest.hasLength(2)); | 619 unittest.expect(o, unittest.hasLength(2)); |
| 585 checkComposeRequestSourceObjects(o[0]); | 620 checkComposeRequestSourceObjects(o[0]); |
| 586 checkComposeRequestSourceObjects(o[1]); | 621 checkComposeRequestSourceObjects(o[1]); |
| 587 } | 622 } |
| 588 | 623 |
| 589 core.int buildCounterComposeRequest = 0; | 624 core.int buildCounterComposeRequest = 0; |
| 590 buildComposeRequest() { | 625 buildComposeRequest() { |
| 591 var o = new api.ComposeRequest(); | 626 var o = new api.ComposeRequest(); |
| 592 buildCounterComposeRequest++; | 627 buildCounterComposeRequest++; |
| 593 if (buildCounterComposeRequest < 3) { | 628 if (buildCounterComposeRequest < 3) { |
| 594 o.destination = buildObject(); | 629 o.destination = buildObject(); |
| 595 o.kind = "foo"; | 630 o.kind = "foo"; |
| 596 o.sourceObjects = buildUnnamed800(); | 631 o.sourceObjects = buildUnnamed1339(); |
| 597 } | 632 } |
| 598 buildCounterComposeRequest--; | 633 buildCounterComposeRequest--; |
| 599 return o; | 634 return o; |
| 600 } | 635 } |
| 601 | 636 |
| 602 checkComposeRequest(api.ComposeRequest o) { | 637 checkComposeRequest(api.ComposeRequest o) { |
| 603 buildCounterComposeRequest++; | 638 buildCounterComposeRequest++; |
| 604 if (buildCounterComposeRequest < 3) { | 639 if (buildCounterComposeRequest < 3) { |
| 605 checkObject(o.destination); | 640 checkObject(o.destination); |
| 606 unittest.expect(o.kind, unittest.equals('foo')); | 641 unittest.expect(o.kind, unittest.equals('foo')); |
| 607 checkUnnamed800(o.sourceObjects); | 642 checkUnnamed1339(o.sourceObjects); |
| 608 } | 643 } |
| 609 buildCounterComposeRequest--; | 644 buildCounterComposeRequest--; |
| 610 } | 645 } |
| 611 | 646 |
| 612 buildUnnamed801() { | 647 buildUnnamed1340() { |
| 613 var o = new core.List<api.ObjectAccessControl>(); | 648 var o = new core.List<api.ObjectAccessControl>(); |
| 614 o.add(buildObjectAccessControl()); | 649 o.add(buildObjectAccessControl()); |
| 615 o.add(buildObjectAccessControl()); | 650 o.add(buildObjectAccessControl()); |
| 616 return o; | 651 return o; |
| 617 } | 652 } |
| 618 | 653 |
| 619 checkUnnamed801(core.List<api.ObjectAccessControl> o) { | 654 checkUnnamed1340(core.List<api.ObjectAccessControl> o) { |
| 620 unittest.expect(o, unittest.hasLength(2)); | 655 unittest.expect(o, unittest.hasLength(2)); |
| 621 checkObjectAccessControl(o[0]); | 656 checkObjectAccessControl(o[0]); |
| 622 checkObjectAccessControl(o[1]); | 657 checkObjectAccessControl(o[1]); |
| 623 } | 658 } |
| 624 | 659 |
| 625 buildUnnamed802() { | 660 buildUnnamed1341() { |
| 626 var o = new core.Map<core.String, core.String>(); | 661 var o = new core.Map<core.String, core.String>(); |
| 627 o["x"] = "foo"; | 662 o["x"] = "foo"; |
| 628 o["y"] = "foo"; | 663 o["y"] = "foo"; |
| 629 return o; | 664 return o; |
| 630 } | 665 } |
| 631 | 666 |
| 632 checkUnnamed802(core.Map<core.String, core.String> o) { | 667 checkUnnamed1341(core.Map<core.String, core.String> o) { |
| 633 unittest.expect(o, unittest.hasLength(2)); | 668 unittest.expect(o, unittest.hasLength(2)); |
| 634 unittest.expect(o["x"], unittest.equals('foo')); | 669 unittest.expect(o["x"], unittest.equals('foo')); |
| 635 unittest.expect(o["y"], unittest.equals('foo')); | 670 unittest.expect(o["y"], unittest.equals('foo')); |
| 636 } | 671 } |
| 637 | 672 |
| 638 core.int buildCounterObjectOwner = 0; | 673 core.int buildCounterObjectOwner = 0; |
| 639 buildObjectOwner() { | 674 buildObjectOwner() { |
| 640 var o = new api.ObjectOwner(); | 675 var o = new api.ObjectOwner(); |
| 641 buildCounterObjectOwner++; | 676 buildCounterObjectOwner++; |
| 642 if (buildCounterObjectOwner < 3) { | 677 if (buildCounterObjectOwner < 3) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 654 unittest.expect(o.entityId, unittest.equals('foo')); | 689 unittest.expect(o.entityId, unittest.equals('foo')); |
| 655 } | 690 } |
| 656 buildCounterObjectOwner--; | 691 buildCounterObjectOwner--; |
| 657 } | 692 } |
| 658 | 693 |
| 659 core.int buildCounterObject = 0; | 694 core.int buildCounterObject = 0; |
| 660 buildObject() { | 695 buildObject() { |
| 661 var o = new api.Object(); | 696 var o = new api.Object(); |
| 662 buildCounterObject++; | 697 buildCounterObject++; |
| 663 if (buildCounterObject < 3) { | 698 if (buildCounterObject < 3) { |
| 664 o.acl = buildUnnamed801(); | 699 o.acl = buildUnnamed1340(); |
| 665 o.bucket = "foo"; | 700 o.bucket = "foo"; |
| 666 o.cacheControl = "foo"; | 701 o.cacheControl = "foo"; |
| 667 o.componentCount = 42; | 702 o.componentCount = 42; |
| 668 o.contentDisposition = "foo"; | 703 o.contentDisposition = "foo"; |
| 669 o.contentEncoding = "foo"; | 704 o.contentEncoding = "foo"; |
| 670 o.contentLanguage = "foo"; | 705 o.contentLanguage = "foo"; |
| 671 o.contentType = "foo"; | 706 o.contentType = "foo"; |
| 672 o.crc32c = "foo"; | 707 o.crc32c = "foo"; |
| 673 o.etag = "foo"; | 708 o.etag = "foo"; |
| 674 o.generation = "foo"; | 709 o.generation = "foo"; |
| 675 o.id = "foo"; | 710 o.id = "foo"; |
| 676 o.kind = "foo"; | 711 o.kind = "foo"; |
| 677 o.md5Hash = "foo"; | 712 o.md5Hash = "foo"; |
| 678 o.mediaLink = "foo"; | 713 o.mediaLink = "foo"; |
| 679 o.metadata = buildUnnamed802(); | 714 o.metadata = buildUnnamed1341(); |
| 680 o.metageneration = "foo"; | 715 o.metageneration = "foo"; |
| 681 o.name = "foo"; | 716 o.name = "foo"; |
| 682 o.owner = buildObjectOwner(); | 717 o.owner = buildObjectOwner(); |
| 683 o.selfLink = "foo"; | 718 o.selfLink = "foo"; |
| 684 o.size = "foo"; | 719 o.size = "foo"; |
| 685 o.storageClass = "foo"; | 720 o.storageClass = "foo"; |
| 686 o.timeDeleted = core.DateTime.parse("2002-02-27T14:01:02"); | 721 o.timeDeleted = core.DateTime.parse("2002-02-27T14:01:02"); |
| 687 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); | 722 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
| 688 } | 723 } |
| 689 buildCounterObject--; | 724 buildCounterObject--; |
| 690 return o; | 725 return o; |
| 691 } | 726 } |
| 692 | 727 |
| 693 checkObject(api.Object o) { | 728 checkObject(api.Object o) { |
| 694 buildCounterObject++; | 729 buildCounterObject++; |
| 695 if (buildCounterObject < 3) { | 730 if (buildCounterObject < 3) { |
| 696 checkUnnamed801(o.acl); | 731 checkUnnamed1340(o.acl); |
| 697 unittest.expect(o.bucket, unittest.equals('foo')); | 732 unittest.expect(o.bucket, unittest.equals('foo')); |
| 698 unittest.expect(o.cacheControl, unittest.equals('foo')); | 733 unittest.expect(o.cacheControl, unittest.equals('foo')); |
| 699 unittest.expect(o.componentCount, unittest.equals(42)); | 734 unittest.expect(o.componentCount, unittest.equals(42)); |
| 700 unittest.expect(o.contentDisposition, unittest.equals('foo')); | 735 unittest.expect(o.contentDisposition, unittest.equals('foo')); |
| 701 unittest.expect(o.contentEncoding, unittest.equals('foo')); | 736 unittest.expect(o.contentEncoding, unittest.equals('foo')); |
| 702 unittest.expect(o.contentLanguage, unittest.equals('foo')); | 737 unittest.expect(o.contentLanguage, unittest.equals('foo')); |
| 703 unittest.expect(o.contentType, unittest.equals('foo')); | 738 unittest.expect(o.contentType, unittest.equals('foo')); |
| 704 unittest.expect(o.crc32c, unittest.equals('foo')); | 739 unittest.expect(o.crc32c, unittest.equals('foo')); |
| 705 unittest.expect(o.etag, unittest.equals('foo')); | 740 unittest.expect(o.etag, unittest.equals('foo')); |
| 706 unittest.expect(o.generation, unittest.equals('foo')); | 741 unittest.expect(o.generation, unittest.equals('foo')); |
| 707 unittest.expect(o.id, unittest.equals('foo')); | 742 unittest.expect(o.id, unittest.equals('foo')); |
| 708 unittest.expect(o.kind, unittest.equals('foo')); | 743 unittest.expect(o.kind, unittest.equals('foo')); |
| 709 unittest.expect(o.md5Hash, unittest.equals('foo')); | 744 unittest.expect(o.md5Hash, unittest.equals('foo')); |
| 710 unittest.expect(o.mediaLink, unittest.equals('foo')); | 745 unittest.expect(o.mediaLink, unittest.equals('foo')); |
| 711 checkUnnamed802(o.metadata); | 746 checkUnnamed1341(o.metadata); |
| 712 unittest.expect(o.metageneration, unittest.equals('foo')); | 747 unittest.expect(o.metageneration, unittest.equals('foo')); |
| 713 unittest.expect(o.name, unittest.equals('foo')); | 748 unittest.expect(o.name, unittest.equals('foo')); |
| 714 checkObjectOwner(o.owner); | 749 checkObjectOwner(o.owner); |
| 715 unittest.expect(o.selfLink, unittest.equals('foo')); | 750 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 716 unittest.expect(o.size, unittest.equals('foo')); | 751 unittest.expect(o.size, unittest.equals('foo')); |
| 717 unittest.expect(o.storageClass, unittest.equals('foo')); | 752 unittest.expect(o.storageClass, unittest.equals('foo')); |
| 718 unittest.expect(o.timeDeleted, unittest.equals(core.DateTime.parse("2002-02-
27T14:01:02"))); | 753 unittest.expect(o.timeDeleted, unittest.equals(core.DateTime.parse("2002-02-
27T14:01:02"))); |
| 719 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 754 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 720 } | 755 } |
| 721 buildCounterObject--; | 756 buildCounterObject--; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 unittest.expect(o.id, unittest.equals('foo')); | 813 unittest.expect(o.id, unittest.equals('foo')); |
| 779 unittest.expect(o.kind, unittest.equals('foo')); | 814 unittest.expect(o.kind, unittest.equals('foo')); |
| 780 unittest.expect(o.object, unittest.equals('foo')); | 815 unittest.expect(o.object, unittest.equals('foo')); |
| 781 checkObjectAccessControlProjectTeam(o.projectTeam); | 816 checkObjectAccessControlProjectTeam(o.projectTeam); |
| 782 unittest.expect(o.role, unittest.equals('foo')); | 817 unittest.expect(o.role, unittest.equals('foo')); |
| 783 unittest.expect(o.selfLink, unittest.equals('foo')); | 818 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 784 } | 819 } |
| 785 buildCounterObjectAccessControl--; | 820 buildCounterObjectAccessControl--; |
| 786 } | 821 } |
| 787 | 822 |
| 788 buildUnnamed803() { | 823 buildUnnamed1342() { |
| 789 var o = new core.List<core.Object>(); | 824 var o = new core.List<core.Object>(); |
| 790 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 825 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
| 791 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 826 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
| 792 return o; | 827 return o; |
| 793 } | 828 } |
| 794 | 829 |
| 795 checkUnnamed803(core.List<core.Object> o) { | 830 checkUnnamed1342(core.List<core.Object> o) { |
| 796 unittest.expect(o, unittest.hasLength(2)); | 831 unittest.expect(o, unittest.hasLength(2)); |
| 797 var casted1 = (o[0]) as core.Map; unittest.expect(casted1, unittest.hasLength(
3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], u
nittest.equals('foo')); | 832 var casted1 = (o[0]) as core.Map; unittest.expect(casted1, unittest.hasLength(
3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], u
nittest.equals('foo')); |
| 798 var casted2 = (o[1]) as core.Map; unittest.expect(casted2, unittest.hasLength(
3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], u
nittest.equals('foo')); | 833 var casted2 = (o[1]) as core.Map; unittest.expect(casted2, unittest.hasLength(
3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], u
nittest.equals('foo')); |
| 799 } | 834 } |
| 800 | 835 |
| 801 core.int buildCounterObjectAccessControls = 0; | 836 core.int buildCounterObjectAccessControls = 0; |
| 802 buildObjectAccessControls() { | 837 buildObjectAccessControls() { |
| 803 var o = new api.ObjectAccessControls(); | 838 var o = new api.ObjectAccessControls(); |
| 804 buildCounterObjectAccessControls++; | 839 buildCounterObjectAccessControls++; |
| 805 if (buildCounterObjectAccessControls < 3) { | 840 if (buildCounterObjectAccessControls < 3) { |
| 806 o.items = buildUnnamed803(); | 841 o.items = buildUnnamed1342(); |
| 807 o.kind = "foo"; | 842 o.kind = "foo"; |
| 808 } | 843 } |
| 809 buildCounterObjectAccessControls--; | 844 buildCounterObjectAccessControls--; |
| 810 return o; | 845 return o; |
| 811 } | 846 } |
| 812 | 847 |
| 813 checkObjectAccessControls(api.ObjectAccessControls o) { | 848 checkObjectAccessControls(api.ObjectAccessControls o) { |
| 814 buildCounterObjectAccessControls++; | 849 buildCounterObjectAccessControls++; |
| 815 if (buildCounterObjectAccessControls < 3) { | 850 if (buildCounterObjectAccessControls < 3) { |
| 816 checkUnnamed803(o.items); | 851 checkUnnamed1342(o.items); |
| 817 unittest.expect(o.kind, unittest.equals('foo')); | 852 unittest.expect(o.kind, unittest.equals('foo')); |
| 818 } | 853 } |
| 819 buildCounterObjectAccessControls--; | 854 buildCounterObjectAccessControls--; |
| 820 } | 855 } |
| 821 | 856 |
| 822 buildUnnamed804() { | 857 buildUnnamed1343() { |
| 823 var o = new core.List<api.Object>(); | 858 var o = new core.List<api.Object>(); |
| 824 o.add(buildObject()); | 859 o.add(buildObject()); |
| 825 o.add(buildObject()); | 860 o.add(buildObject()); |
| 826 return o; | 861 return o; |
| 827 } | 862 } |
| 828 | 863 |
| 829 checkUnnamed804(core.List<api.Object> o) { | 864 checkUnnamed1343(core.List<api.Object> o) { |
| 830 unittest.expect(o, unittest.hasLength(2)); | 865 unittest.expect(o, unittest.hasLength(2)); |
| 831 checkObject(o[0]); | 866 checkObject(o[0]); |
| 832 checkObject(o[1]); | 867 checkObject(o[1]); |
| 833 } | 868 } |
| 834 | 869 |
| 835 buildUnnamed805() { | 870 buildUnnamed1344() { |
| 836 var o = new core.List<core.String>(); | 871 var o = new core.List<core.String>(); |
| 837 o.add("foo"); | 872 o.add("foo"); |
| 838 o.add("foo"); | 873 o.add("foo"); |
| 839 return o; | 874 return o; |
| 840 } | 875 } |
| 841 | 876 |
| 842 checkUnnamed805(core.List<core.String> o) { | 877 checkUnnamed1344(core.List<core.String> o) { |
| 843 unittest.expect(o, unittest.hasLength(2)); | 878 unittest.expect(o, unittest.hasLength(2)); |
| 844 unittest.expect(o[0], unittest.equals('foo')); | 879 unittest.expect(o[0], unittest.equals('foo')); |
| 845 unittest.expect(o[1], unittest.equals('foo')); | 880 unittest.expect(o[1], unittest.equals('foo')); |
| 846 } | 881 } |
| 847 | 882 |
| 848 core.int buildCounterObjects = 0; | 883 core.int buildCounterObjects = 0; |
| 849 buildObjects() { | 884 buildObjects() { |
| 850 var o = new api.Objects(); | 885 var o = new api.Objects(); |
| 851 buildCounterObjects++; | 886 buildCounterObjects++; |
| 852 if (buildCounterObjects < 3) { | 887 if (buildCounterObjects < 3) { |
| 853 o.items = buildUnnamed804(); | 888 o.items = buildUnnamed1343(); |
| 854 o.kind = "foo"; | 889 o.kind = "foo"; |
| 855 o.nextPageToken = "foo"; | 890 o.nextPageToken = "foo"; |
| 856 o.prefixes = buildUnnamed805(); | 891 o.prefixes = buildUnnamed1344(); |
| 857 } | 892 } |
| 858 buildCounterObjects--; | 893 buildCounterObjects--; |
| 859 return o; | 894 return o; |
| 860 } | 895 } |
| 861 | 896 |
| 862 checkObjects(api.Objects o) { | 897 checkObjects(api.Objects o) { |
| 863 buildCounterObjects++; | 898 buildCounterObjects++; |
| 864 if (buildCounterObjects < 3) { | 899 if (buildCounterObjects < 3) { |
| 865 checkUnnamed804(o.items); | 900 checkUnnamed1343(o.items); |
| 866 unittest.expect(o.kind, unittest.equals('foo')); | 901 unittest.expect(o.kind, unittest.equals('foo')); |
| 867 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 902 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 868 checkUnnamed805(o.prefixes); | 903 checkUnnamed1344(o.prefixes); |
| 869 } | 904 } |
| 870 buildCounterObjects--; | 905 buildCounterObjects--; |
| 871 } | 906 } |
| 872 | 907 |
| 873 | 908 |
| 874 main() { | 909 main() { |
| 875 unittest.group("obj-schema-BucketCors", () { | 910 unittest.group("obj-schema-BucketCors", () { |
| 876 unittest.test("to-json--from-json", () { | 911 unittest.test("to-json--from-json", () { |
| 877 var o = buildBucketCors(); | 912 var o = buildBucketCors(); |
| 878 var od = new api.BucketCors.fromJson(o.toJson()); | 913 var od = new api.BucketCors.fromJson(o.toJson()); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 var o = buildObjects(); | 1119 var o = buildObjects(); |
| 1085 var od = new api.Objects.fromJson(o.toJson()); | 1120 var od = new api.Objects.fromJson(o.toJson()); |
| 1086 checkObjects(od); | 1121 checkObjects(od); |
| 1087 }); | 1122 }); |
| 1088 }); | 1123 }); |
| 1089 | 1124 |
| 1090 | 1125 |
| 1091 unittest.group("resource-BucketAccessControlsResourceApi", () { | 1126 unittest.group("resource-BucketAccessControlsResourceApi", () { |
| 1092 unittest.test("method--delete", () { | 1127 unittest.test("method--delete", () { |
| 1093 | 1128 |
| 1094 var mock = new common_test.HttpServerMock(); | 1129 var mock = new HttpServerMock(); |
| 1095 api.BucketAccessControlsResourceApi res = new api.StorageApi(mock).bucketA
ccessControls; | 1130 api.BucketAccessControlsResourceApi res = new api.StorageApi(mock).bucketA
ccessControls; |
| 1096 var arg_bucket = "foo"; | 1131 var arg_bucket = "foo"; |
| 1097 var arg_entity = "foo"; | 1132 var arg_entity = "foo"; |
| 1098 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1133 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1099 var path = (req.url).path; | 1134 var path = (req.url).path; |
| 1100 var pathOffset = 0; | 1135 var pathOffset = 0; |
| 1101 var index; | 1136 var index; |
| 1102 var subPart; | 1137 var subPart; |
| 1103 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1138 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1104 pathOffset += 1; | 1139 pathOffset += 1; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1132 var keyvalue = part.split("="); | 1167 var keyvalue = part.split("="); |
| 1133 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1168 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1134 } | 1169 } |
| 1135 } | 1170 } |
| 1136 | 1171 |
| 1137 | 1172 |
| 1138 var h = { | 1173 var h = { |
| 1139 "content-type" : "application/json; charset=utf-8", | 1174 "content-type" : "application/json; charset=utf-8", |
| 1140 }; | 1175 }; |
| 1141 var resp = ""; | 1176 var resp = ""; |
| 1142 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1177 return new async.Future.value(stringResponse(200, h, resp)); |
| 1143 }), true); | 1178 }), true); |
| 1144 res.delete(arg_bucket, arg_entity).then(unittest.expectAsync((_) {})); | 1179 res.delete(arg_bucket, arg_entity).then(unittest.expectAsync((_) {})); |
| 1145 }); | 1180 }); |
| 1146 | 1181 |
| 1147 unittest.test("method--get", () { | 1182 unittest.test("method--get", () { |
| 1148 | 1183 |
| 1149 var mock = new common_test.HttpServerMock(); | 1184 var mock = new HttpServerMock(); |
| 1150 api.BucketAccessControlsResourceApi res = new api.StorageApi(mock).bucketA
ccessControls; | 1185 api.BucketAccessControlsResourceApi res = new api.StorageApi(mock).bucketA
ccessControls; |
| 1151 var arg_bucket = "foo"; | 1186 var arg_bucket = "foo"; |
| 1152 var arg_entity = "foo"; | 1187 var arg_entity = "foo"; |
| 1153 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1188 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1154 var path = (req.url).path; | 1189 var path = (req.url).path; |
| 1155 var pathOffset = 0; | 1190 var pathOffset = 0; |
| 1156 var index; | 1191 var index; |
| 1157 var subPart; | 1192 var subPart; |
| 1158 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1193 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1159 pathOffset += 1; | 1194 pathOffset += 1; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1187 var keyvalue = part.split("="); | 1222 var keyvalue = part.split("="); |
| 1188 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1223 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1189 } | 1224 } |
| 1190 } | 1225 } |
| 1191 | 1226 |
| 1192 | 1227 |
| 1193 var h = { | 1228 var h = { |
| 1194 "content-type" : "application/json; charset=utf-8", | 1229 "content-type" : "application/json; charset=utf-8", |
| 1195 }; | 1230 }; |
| 1196 var resp = convert.JSON.encode(buildBucketAccessControl()); | 1231 var resp = convert.JSON.encode(buildBucketAccessControl()); |
| 1197 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1232 return new async.Future.value(stringResponse(200, h, resp)); |
| 1198 }), true); | 1233 }), true); |
| 1199 res.get(arg_bucket, arg_entity).then(unittest.expectAsync(((api.BucketAcce
ssControl response) { | 1234 res.get(arg_bucket, arg_entity).then(unittest.expectAsync(((api.BucketAcce
ssControl response) { |
| 1200 checkBucketAccessControl(response); | 1235 checkBucketAccessControl(response); |
| 1201 }))); | 1236 }))); |
| 1202 }); | 1237 }); |
| 1203 | 1238 |
| 1204 unittest.test("method--insert", () { | 1239 unittest.test("method--insert", () { |
| 1205 | 1240 |
| 1206 var mock = new common_test.HttpServerMock(); | 1241 var mock = new HttpServerMock(); |
| 1207 api.BucketAccessControlsResourceApi res = new api.StorageApi(mock).bucketA
ccessControls; | 1242 api.BucketAccessControlsResourceApi res = new api.StorageApi(mock).bucketA
ccessControls; |
| 1208 var arg_request = buildBucketAccessControl(); | 1243 var arg_request = buildBucketAccessControl(); |
| 1209 var arg_bucket = "foo"; | 1244 var arg_bucket = "foo"; |
| 1210 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1245 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1211 var obj = new api.BucketAccessControl.fromJson(json); | 1246 var obj = new api.BucketAccessControl.fromJson(json); |
| 1212 checkBucketAccessControl(obj); | 1247 checkBucketAccessControl(obj); |
| 1213 | 1248 |
| 1214 var path = (req.url).path; | 1249 var path = (req.url).path; |
| 1215 var pathOffset = 0; | 1250 var pathOffset = 0; |
| 1216 var index; | 1251 var index; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1244 var keyvalue = part.split("="); | 1279 var keyvalue = part.split("="); |
| 1245 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1280 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1246 } | 1281 } |
| 1247 } | 1282 } |
| 1248 | 1283 |
| 1249 | 1284 |
| 1250 var h = { | 1285 var h = { |
| 1251 "content-type" : "application/json; charset=utf-8", | 1286 "content-type" : "application/json; charset=utf-8", |
| 1252 }; | 1287 }; |
| 1253 var resp = convert.JSON.encode(buildBucketAccessControl()); | 1288 var resp = convert.JSON.encode(buildBucketAccessControl()); |
| 1254 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1289 return new async.Future.value(stringResponse(200, h, resp)); |
| 1255 }), true); | 1290 }), true); |
| 1256 res.insert(arg_request, arg_bucket).then(unittest.expectAsync(((api.Bucket
AccessControl response) { | 1291 res.insert(arg_request, arg_bucket).then(unittest.expectAsync(((api.Bucket
AccessControl response) { |
| 1257 checkBucketAccessControl(response); | 1292 checkBucketAccessControl(response); |
| 1258 }))); | 1293 }))); |
| 1259 }); | 1294 }); |
| 1260 | 1295 |
| 1261 unittest.test("method--list", () { | 1296 unittest.test("method--list", () { |
| 1262 | 1297 |
| 1263 var mock = new common_test.HttpServerMock(); | 1298 var mock = new HttpServerMock(); |
| 1264 api.BucketAccessControlsResourceApi res = new api.StorageApi(mock).bucketA
ccessControls; | 1299 api.BucketAccessControlsResourceApi res = new api.StorageApi(mock).bucketA
ccessControls; |
| 1265 var arg_bucket = "foo"; | 1300 var arg_bucket = "foo"; |
| 1266 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1301 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1267 var path = (req.url).path; | 1302 var path = (req.url).path; |
| 1268 var pathOffset = 0; | 1303 var pathOffset = 0; |
| 1269 var index; | 1304 var index; |
| 1270 var subPart; | 1305 var subPart; |
| 1271 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1306 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1272 pathOffset += 1; | 1307 pathOffset += 1; |
| 1273 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("storage/v1/")); | 1308 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("storage/v1/")); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1297 var keyvalue = part.split("="); | 1332 var keyvalue = part.split("="); |
| 1298 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1333 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1299 } | 1334 } |
| 1300 } | 1335 } |
| 1301 | 1336 |
| 1302 | 1337 |
| 1303 var h = { | 1338 var h = { |
| 1304 "content-type" : "application/json; charset=utf-8", | 1339 "content-type" : "application/json; charset=utf-8", |
| 1305 }; | 1340 }; |
| 1306 var resp = convert.JSON.encode(buildBucketAccessControls()); | 1341 var resp = convert.JSON.encode(buildBucketAccessControls()); |
| 1307 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1342 return new async.Future.value(stringResponse(200, h, resp)); |
| 1308 }), true); | 1343 }), true); |
| 1309 res.list(arg_bucket).then(unittest.expectAsync(((api.BucketAccessControls
response) { | 1344 res.list(arg_bucket).then(unittest.expectAsync(((api.BucketAccessControls
response) { |
| 1310 checkBucketAccessControls(response); | 1345 checkBucketAccessControls(response); |
| 1311 }))); | 1346 }))); |
| 1312 }); | 1347 }); |
| 1313 | 1348 |
| 1314 unittest.test("method--patch", () { | 1349 unittest.test("method--patch", () { |
| 1315 | 1350 |
| 1316 var mock = new common_test.HttpServerMock(); | 1351 var mock = new HttpServerMock(); |
| 1317 api.BucketAccessControlsResourceApi res = new api.StorageApi(mock).bucketA
ccessControls; | 1352 api.BucketAccessControlsResourceApi res = new api.StorageApi(mock).bucketA
ccessControls; |
| 1318 var arg_request = buildBucketAccessControl(); | 1353 var arg_request = buildBucketAccessControl(); |
| 1319 var arg_bucket = "foo"; | 1354 var arg_bucket = "foo"; |
| 1320 var arg_entity = "foo"; | 1355 var arg_entity = "foo"; |
| 1321 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1356 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1322 var obj = new api.BucketAccessControl.fromJson(json); | 1357 var obj = new api.BucketAccessControl.fromJson(json); |
| 1323 checkBucketAccessControl(obj); | 1358 checkBucketAccessControl(obj); |
| 1324 | 1359 |
| 1325 var path = (req.url).path; | 1360 var path = (req.url).path; |
| 1326 var pathOffset = 0; | 1361 var pathOffset = 0; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 var keyvalue = part.split("="); | 1393 var keyvalue = part.split("="); |
| 1359 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1394 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1360 } | 1395 } |
| 1361 } | 1396 } |
| 1362 | 1397 |
| 1363 | 1398 |
| 1364 var h = { | 1399 var h = { |
| 1365 "content-type" : "application/json; charset=utf-8", | 1400 "content-type" : "application/json; charset=utf-8", |
| 1366 }; | 1401 }; |
| 1367 var resp = convert.JSON.encode(buildBucketAccessControl()); | 1402 var resp = convert.JSON.encode(buildBucketAccessControl()); |
| 1368 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1403 return new async.Future.value(stringResponse(200, h, resp)); |
| 1369 }), true); | 1404 }), true); |
| 1370 res.patch(arg_request, arg_bucket, arg_entity).then(unittest.expectAsync((
(api.BucketAccessControl response) { | 1405 res.patch(arg_request, arg_bucket, arg_entity).then(unittest.expectAsync((
(api.BucketAccessControl response) { |
| 1371 checkBucketAccessControl(response); | 1406 checkBucketAccessControl(response); |
| 1372 }))); | 1407 }))); |
| 1373 }); | 1408 }); |
| 1374 | 1409 |
| 1375 unittest.test("method--update", () { | 1410 unittest.test("method--update", () { |
| 1376 | 1411 |
| 1377 var mock = new common_test.HttpServerMock(); | 1412 var mock = new HttpServerMock(); |
| 1378 api.BucketAccessControlsResourceApi res = new api.StorageApi(mock).bucketA
ccessControls; | 1413 api.BucketAccessControlsResourceApi res = new api.StorageApi(mock).bucketA
ccessControls; |
| 1379 var arg_request = buildBucketAccessControl(); | 1414 var arg_request = buildBucketAccessControl(); |
| 1380 var arg_bucket = "foo"; | 1415 var arg_bucket = "foo"; |
| 1381 var arg_entity = "foo"; | 1416 var arg_entity = "foo"; |
| 1382 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1417 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1383 var obj = new api.BucketAccessControl.fromJson(json); | 1418 var obj = new api.BucketAccessControl.fromJson(json); |
| 1384 checkBucketAccessControl(obj); | 1419 checkBucketAccessControl(obj); |
| 1385 | 1420 |
| 1386 var path = (req.url).path; | 1421 var path = (req.url).path; |
| 1387 var pathOffset = 0; | 1422 var pathOffset = 0; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1419 var keyvalue = part.split("="); | 1454 var keyvalue = part.split("="); |
| 1420 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])); |
| 1421 } | 1456 } |
| 1422 } | 1457 } |
| 1423 | 1458 |
| 1424 | 1459 |
| 1425 var h = { | 1460 var h = { |
| 1426 "content-type" : "application/json; charset=utf-8", | 1461 "content-type" : "application/json; charset=utf-8", |
| 1427 }; | 1462 }; |
| 1428 var resp = convert.JSON.encode(buildBucketAccessControl()); | 1463 var resp = convert.JSON.encode(buildBucketAccessControl()); |
| 1429 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1464 return new async.Future.value(stringResponse(200, h, resp)); |
| 1430 }), true); | 1465 }), true); |
| 1431 res.update(arg_request, arg_bucket, arg_entity).then(unittest.expectAsync(
((api.BucketAccessControl response) { | 1466 res.update(arg_request, arg_bucket, arg_entity).then(unittest.expectAsync(
((api.BucketAccessControl response) { |
| 1432 checkBucketAccessControl(response); | 1467 checkBucketAccessControl(response); |
| 1433 }))); | 1468 }))); |
| 1434 }); | 1469 }); |
| 1435 | 1470 |
| 1436 }); | 1471 }); |
| 1437 | 1472 |
| 1438 | 1473 |
| 1439 unittest.group("resource-BucketsResourceApi", () { | 1474 unittest.group("resource-BucketsResourceApi", () { |
| 1440 unittest.test("method--delete", () { | 1475 unittest.test("method--delete", () { |
| 1441 | 1476 |
| 1442 var mock = new common_test.HttpServerMock(); | 1477 var mock = new HttpServerMock(); |
| 1443 api.BucketsResourceApi res = new api.StorageApi(mock).buckets; | 1478 api.BucketsResourceApi res = new api.StorageApi(mock).buckets; |
| 1444 var arg_bucket = "foo"; | 1479 var arg_bucket = "foo"; |
| 1445 var arg_ifMetagenerationMatch = "foo"; | 1480 var arg_ifMetagenerationMatch = "foo"; |
| 1446 var arg_ifMetagenerationNotMatch = "foo"; | 1481 var arg_ifMetagenerationNotMatch = "foo"; |
| 1447 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1482 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1448 var path = (req.url).path; | 1483 var path = (req.url).path; |
| 1449 var pathOffset = 0; | 1484 var pathOffset = 0; |
| 1450 var index; | 1485 var index; |
| 1451 var subPart; | 1486 var subPart; |
| 1452 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1487 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1476 } | 1511 } |
| 1477 } | 1512 } |
| 1478 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); | 1513 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); |
| 1479 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); | 1514 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); |
| 1480 | 1515 |
| 1481 | 1516 |
| 1482 var h = { | 1517 var h = { |
| 1483 "content-type" : "application/json; charset=utf-8", | 1518 "content-type" : "application/json; charset=utf-8", |
| 1484 }; | 1519 }; |
| 1485 var resp = ""; | 1520 var resp = ""; |
| 1486 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1521 return new async.Future.value(stringResponse(200, h, resp)); |
| 1487 }), true); | 1522 }), true); |
| 1488 res.delete(arg_bucket, ifMetagenerationMatch: arg_ifMetagenerationMatch, i
fMetagenerationNotMatch: arg_ifMetagenerationNotMatch).then(unittest.expectAsync
((_) {})); | 1523 res.delete(arg_bucket, ifMetagenerationMatch: arg_ifMetagenerationMatch, i
fMetagenerationNotMatch: arg_ifMetagenerationNotMatch).then(unittest.expectAsync
((_) {})); |
| 1489 }); | 1524 }); |
| 1490 | 1525 |
| 1491 unittest.test("method--get", () { | 1526 unittest.test("method--get", () { |
| 1492 | 1527 |
| 1493 var mock = new common_test.HttpServerMock(); | 1528 var mock = new HttpServerMock(); |
| 1494 api.BucketsResourceApi res = new api.StorageApi(mock).buckets; | 1529 api.BucketsResourceApi res = new api.StorageApi(mock).buckets; |
| 1495 var arg_bucket = "foo"; | 1530 var arg_bucket = "foo"; |
| 1496 var arg_ifMetagenerationMatch = "foo"; | 1531 var arg_ifMetagenerationMatch = "foo"; |
| 1497 var arg_ifMetagenerationNotMatch = "foo"; | 1532 var arg_ifMetagenerationNotMatch = "foo"; |
| 1498 var arg_projection = "foo"; | 1533 var arg_projection = "foo"; |
| 1499 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1534 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1500 var path = (req.url).path; | 1535 var path = (req.url).path; |
| 1501 var pathOffset = 0; | 1536 var pathOffset = 0; |
| 1502 var index; | 1537 var index; |
| 1503 var subPart; | 1538 var subPart; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1529 } | 1564 } |
| 1530 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); | 1565 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); |
| 1531 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); | 1566 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); |
| 1532 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | 1567 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); |
| 1533 | 1568 |
| 1534 | 1569 |
| 1535 var h = { | 1570 var h = { |
| 1536 "content-type" : "application/json; charset=utf-8", | 1571 "content-type" : "application/json; charset=utf-8", |
| 1537 }; | 1572 }; |
| 1538 var resp = convert.JSON.encode(buildBucket()); | 1573 var resp = convert.JSON.encode(buildBucket()); |
| 1539 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1574 return new async.Future.value(stringResponse(200, h, resp)); |
| 1540 }), true); | 1575 }), true); |
| 1541 res.get(arg_bucket, ifMetagenerationMatch: arg_ifMetagenerationMatch, ifMe
tagenerationNotMatch: arg_ifMetagenerationNotMatch, projection: arg_projection).
then(unittest.expectAsync(((api.Bucket response) { | 1576 res.get(arg_bucket, ifMetagenerationMatch: arg_ifMetagenerationMatch, ifMe
tagenerationNotMatch: arg_ifMetagenerationNotMatch, projection: arg_projection).
then(unittest.expectAsync(((api.Bucket response) { |
| 1542 checkBucket(response); | 1577 checkBucket(response); |
| 1543 }))); | 1578 }))); |
| 1544 }); | 1579 }); |
| 1545 | 1580 |
| 1546 unittest.test("method--insert", () { | 1581 unittest.test("method--insert", () { |
| 1547 | 1582 |
| 1548 var mock = new common_test.HttpServerMock(); | 1583 var mock = new HttpServerMock(); |
| 1549 api.BucketsResourceApi res = new api.StorageApi(mock).buckets; | 1584 api.BucketsResourceApi res = new api.StorageApi(mock).buckets; |
| 1550 var arg_request = buildBucket(); | 1585 var arg_request = buildBucket(); |
| 1551 var arg_project = "foo"; | 1586 var arg_project = "foo"; |
| 1552 var arg_predefinedAcl = "foo"; | 1587 var arg_predefinedAcl = "foo"; |
| 1553 var arg_predefinedDefaultObjectAcl = "foo"; | 1588 var arg_predefinedDefaultObjectAcl = "foo"; |
| 1554 var arg_projection = "foo"; | 1589 var arg_projection = "foo"; |
| 1555 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1590 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1556 var obj = new api.Bucket.fromJson(json); | 1591 var obj = new api.Bucket.fromJson(json); |
| 1557 checkBucket(obj); | 1592 checkBucket(obj); |
| 1558 | 1593 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1586 unittest.expect(queryMap["project"].first, unittest.equals(arg_project))
; | 1621 unittest.expect(queryMap["project"].first, unittest.equals(arg_project))
; |
| 1587 unittest.expect(queryMap["predefinedAcl"].first, unittest.equals(arg_pre
definedAcl)); | 1622 unittest.expect(queryMap["predefinedAcl"].first, unittest.equals(arg_pre
definedAcl)); |
| 1588 unittest.expect(queryMap["predefinedDefaultObjectAcl"].first, unittest.e
quals(arg_predefinedDefaultObjectAcl)); | 1623 unittest.expect(queryMap["predefinedDefaultObjectAcl"].first, unittest.e
quals(arg_predefinedDefaultObjectAcl)); |
| 1589 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | 1624 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); |
| 1590 | 1625 |
| 1591 | 1626 |
| 1592 var h = { | 1627 var h = { |
| 1593 "content-type" : "application/json; charset=utf-8", | 1628 "content-type" : "application/json; charset=utf-8", |
| 1594 }; | 1629 }; |
| 1595 var resp = convert.JSON.encode(buildBucket()); | 1630 var resp = convert.JSON.encode(buildBucket()); |
| 1596 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1631 return new async.Future.value(stringResponse(200, h, resp)); |
| 1597 }), true); | 1632 }), true); |
| 1598 res.insert(arg_request, arg_project, predefinedAcl: arg_predefinedAcl, pre
definedDefaultObjectAcl: arg_predefinedDefaultObjectAcl, projection: arg_project
ion).then(unittest.expectAsync(((api.Bucket response) { | 1633 res.insert(arg_request, arg_project, predefinedAcl: arg_predefinedAcl, pre
definedDefaultObjectAcl: arg_predefinedDefaultObjectAcl, projection: arg_project
ion).then(unittest.expectAsync(((api.Bucket response) { |
| 1599 checkBucket(response); | 1634 checkBucket(response); |
| 1600 }))); | 1635 }))); |
| 1601 }); | 1636 }); |
| 1602 | 1637 |
| 1603 unittest.test("method--list", () { | 1638 unittest.test("method--list", () { |
| 1604 | 1639 |
| 1605 var mock = new common_test.HttpServerMock(); | 1640 var mock = new HttpServerMock(); |
| 1606 api.BucketsResourceApi res = new api.StorageApi(mock).buckets; | 1641 api.BucketsResourceApi res = new api.StorageApi(mock).buckets; |
| 1607 var arg_project = "foo"; | 1642 var arg_project = "foo"; |
| 1608 var arg_maxResults = 42; | 1643 var arg_maxResults = 42; |
| 1609 var arg_pageToken = "foo"; | 1644 var arg_pageToken = "foo"; |
| 1610 var arg_prefix = "foo"; | 1645 var arg_prefix = "foo"; |
| 1611 var arg_projection = "foo"; | 1646 var arg_projection = "foo"; |
| 1612 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1647 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1613 var path = (req.url).path; | 1648 var path = (req.url).path; |
| 1614 var pathOffset = 0; | 1649 var pathOffset = 0; |
| 1615 var index; | 1650 var index; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1641 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1676 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 1642 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1677 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1643 unittest.expect(queryMap["prefix"].first, unittest.equals(arg_prefix)); | 1678 unittest.expect(queryMap["prefix"].first, unittest.equals(arg_prefix)); |
| 1644 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | 1679 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); |
| 1645 | 1680 |
| 1646 | 1681 |
| 1647 var h = { | 1682 var h = { |
| 1648 "content-type" : "application/json; charset=utf-8", | 1683 "content-type" : "application/json; charset=utf-8", |
| 1649 }; | 1684 }; |
| 1650 var resp = convert.JSON.encode(buildBuckets()); | 1685 var resp = convert.JSON.encode(buildBuckets()); |
| 1651 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1686 return new async.Future.value(stringResponse(200, h, resp)); |
| 1652 }), true); | 1687 }), true); |
| 1653 res.list(arg_project, maxResults: arg_maxResults, pageToken: arg_pageToken
, prefix: arg_prefix, projection: arg_projection).then(unittest.expectAsync(((ap
i.Buckets response) { | 1688 res.list(arg_project, maxResults: arg_maxResults, pageToken: arg_pageToken
, prefix: arg_prefix, projection: arg_projection).then(unittest.expectAsync(((ap
i.Buckets response) { |
| 1654 checkBuckets(response); | 1689 checkBuckets(response); |
| 1655 }))); | 1690 }))); |
| 1656 }); | 1691 }); |
| 1657 | 1692 |
| 1658 unittest.test("method--patch", () { | 1693 unittest.test("method--patch", () { |
| 1659 | 1694 |
| 1660 var mock = new common_test.HttpServerMock(); | 1695 var mock = new HttpServerMock(); |
| 1661 api.BucketsResourceApi res = new api.StorageApi(mock).buckets; | 1696 api.BucketsResourceApi res = new api.StorageApi(mock).buckets; |
| 1662 var arg_request = buildBucket(); | 1697 var arg_request = buildBucket(); |
| 1663 var arg_bucket = "foo"; | 1698 var arg_bucket = "foo"; |
| 1664 var arg_ifMetagenerationMatch = "foo"; | 1699 var arg_ifMetagenerationMatch = "foo"; |
| 1665 var arg_ifMetagenerationNotMatch = "foo"; | 1700 var arg_ifMetagenerationNotMatch = "foo"; |
| 1666 var arg_predefinedAcl = "foo"; | 1701 var arg_predefinedAcl = "foo"; |
| 1667 var arg_predefinedDefaultObjectAcl = "foo"; | 1702 var arg_predefinedDefaultObjectAcl = "foo"; |
| 1668 var arg_projection = "foo"; | 1703 var arg_projection = "foo"; |
| 1669 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1704 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1670 var obj = new api.Bucket.fromJson(json); | 1705 var obj = new api.Bucket.fromJson(json); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1704 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); | 1739 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); |
| 1705 unittest.expect(queryMap["predefinedAcl"].first, unittest.equals(arg_pre
definedAcl)); | 1740 unittest.expect(queryMap["predefinedAcl"].first, unittest.equals(arg_pre
definedAcl)); |
| 1706 unittest.expect(queryMap["predefinedDefaultObjectAcl"].first, unittest.e
quals(arg_predefinedDefaultObjectAcl)); | 1741 unittest.expect(queryMap["predefinedDefaultObjectAcl"].first, unittest.e
quals(arg_predefinedDefaultObjectAcl)); |
| 1707 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | 1742 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); |
| 1708 | 1743 |
| 1709 | 1744 |
| 1710 var h = { | 1745 var h = { |
| 1711 "content-type" : "application/json; charset=utf-8", | 1746 "content-type" : "application/json; charset=utf-8", |
| 1712 }; | 1747 }; |
| 1713 var resp = convert.JSON.encode(buildBucket()); | 1748 var resp = convert.JSON.encode(buildBucket()); |
| 1714 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1749 return new async.Future.value(stringResponse(200, h, resp)); |
| 1715 }), true); | 1750 }), true); |
| 1716 res.patch(arg_request, arg_bucket, ifMetagenerationMatch: arg_ifMetagenera
tionMatch, ifMetagenerationNotMatch: arg_ifMetagenerationNotMatch, predefinedAcl
: arg_predefinedAcl, predefinedDefaultObjectAcl: arg_predefinedDefaultObjectAcl,
projection: arg_projection).then(unittest.expectAsync(((api.Bucket response) { | 1751 res.patch(arg_request, arg_bucket, ifMetagenerationMatch: arg_ifMetagenera
tionMatch, ifMetagenerationNotMatch: arg_ifMetagenerationNotMatch, predefinedAcl
: arg_predefinedAcl, predefinedDefaultObjectAcl: arg_predefinedDefaultObjectAcl,
projection: arg_projection).then(unittest.expectAsync(((api.Bucket response) { |
| 1717 checkBucket(response); | 1752 checkBucket(response); |
| 1718 }))); | 1753 }))); |
| 1719 }); | 1754 }); |
| 1720 | 1755 |
| 1721 unittest.test("method--update", () { | 1756 unittest.test("method--update", () { |
| 1722 | 1757 |
| 1723 var mock = new common_test.HttpServerMock(); | 1758 var mock = new HttpServerMock(); |
| 1724 api.BucketsResourceApi res = new api.StorageApi(mock).buckets; | 1759 api.BucketsResourceApi res = new api.StorageApi(mock).buckets; |
| 1725 var arg_request = buildBucket(); | 1760 var arg_request = buildBucket(); |
| 1726 var arg_bucket = "foo"; | 1761 var arg_bucket = "foo"; |
| 1727 var arg_ifMetagenerationMatch = "foo"; | 1762 var arg_ifMetagenerationMatch = "foo"; |
| 1728 var arg_ifMetagenerationNotMatch = "foo"; | 1763 var arg_ifMetagenerationNotMatch = "foo"; |
| 1729 var arg_predefinedAcl = "foo"; | 1764 var arg_predefinedAcl = "foo"; |
| 1730 var arg_predefinedDefaultObjectAcl = "foo"; | 1765 var arg_predefinedDefaultObjectAcl = "foo"; |
| 1731 var arg_projection = "foo"; | 1766 var arg_projection = "foo"; |
| 1732 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1767 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1733 var obj = new api.Bucket.fromJson(json); | 1768 var obj = new api.Bucket.fromJson(json); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1767 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); | 1802 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); |
| 1768 unittest.expect(queryMap["predefinedAcl"].first, unittest.equals(arg_pre
definedAcl)); | 1803 unittest.expect(queryMap["predefinedAcl"].first, unittest.equals(arg_pre
definedAcl)); |
| 1769 unittest.expect(queryMap["predefinedDefaultObjectAcl"].first, unittest.e
quals(arg_predefinedDefaultObjectAcl)); | 1804 unittest.expect(queryMap["predefinedDefaultObjectAcl"].first, unittest.e
quals(arg_predefinedDefaultObjectAcl)); |
| 1770 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | 1805 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); |
| 1771 | 1806 |
| 1772 | 1807 |
| 1773 var h = { | 1808 var h = { |
| 1774 "content-type" : "application/json; charset=utf-8", | 1809 "content-type" : "application/json; charset=utf-8", |
| 1775 }; | 1810 }; |
| 1776 var resp = convert.JSON.encode(buildBucket()); | 1811 var resp = convert.JSON.encode(buildBucket()); |
| 1777 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1812 return new async.Future.value(stringResponse(200, h, resp)); |
| 1778 }), true); | 1813 }), true); |
| 1779 res.update(arg_request, arg_bucket, ifMetagenerationMatch: arg_ifMetagener
ationMatch, ifMetagenerationNotMatch: arg_ifMetagenerationNotMatch, predefinedAc
l: arg_predefinedAcl, predefinedDefaultObjectAcl: arg_predefinedDefaultObjectAcl
, projection: arg_projection).then(unittest.expectAsync(((api.Bucket response) { | 1814 res.update(arg_request, arg_bucket, ifMetagenerationMatch: arg_ifMetagener
ationMatch, ifMetagenerationNotMatch: arg_ifMetagenerationNotMatch, predefinedAc
l: arg_predefinedAcl, predefinedDefaultObjectAcl: arg_predefinedDefaultObjectAcl
, projection: arg_projection).then(unittest.expectAsync(((api.Bucket response) { |
| 1780 checkBucket(response); | 1815 checkBucket(response); |
| 1781 }))); | 1816 }))); |
| 1782 }); | 1817 }); |
| 1783 | 1818 |
| 1784 }); | 1819 }); |
| 1785 | 1820 |
| 1786 | 1821 |
| 1787 unittest.group("resource-ChannelsResourceApi", () { | 1822 unittest.group("resource-ChannelsResourceApi", () { |
| 1788 unittest.test("method--stop", () { | 1823 unittest.test("method--stop", () { |
| 1789 | 1824 |
| 1790 var mock = new common_test.HttpServerMock(); | 1825 var mock = new HttpServerMock(); |
| 1791 api.ChannelsResourceApi res = new api.StorageApi(mock).channels; | 1826 api.ChannelsResourceApi res = new api.StorageApi(mock).channels; |
| 1792 var arg_request = buildChannel(); | 1827 var arg_request = buildChannel(); |
| 1793 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1828 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1794 var obj = new api.Channel.fromJson(json); | 1829 var obj = new api.Channel.fromJson(json); |
| 1795 checkChannel(obj); | 1830 checkChannel(obj); |
| 1796 | 1831 |
| 1797 var path = (req.url).path; | 1832 var path = (req.url).path; |
| 1798 var pathOffset = 0; | 1833 var pathOffset = 0; |
| 1799 var index; | 1834 var index; |
| 1800 var subPart; | 1835 var subPart; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1820 var keyvalue = part.split("="); | 1855 var keyvalue = part.split("="); |
| 1821 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1856 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1822 } | 1857 } |
| 1823 } | 1858 } |
| 1824 | 1859 |
| 1825 | 1860 |
| 1826 var h = { | 1861 var h = { |
| 1827 "content-type" : "application/json; charset=utf-8", | 1862 "content-type" : "application/json; charset=utf-8", |
| 1828 }; | 1863 }; |
| 1829 var resp = ""; | 1864 var resp = ""; |
| 1830 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1865 return new async.Future.value(stringResponse(200, h, resp)); |
| 1831 }), true); | 1866 }), true); |
| 1832 res.stop(arg_request).then(unittest.expectAsync((_) {})); | 1867 res.stop(arg_request).then(unittest.expectAsync((_) {})); |
| 1833 }); | 1868 }); |
| 1834 | 1869 |
| 1835 }); | 1870 }); |
| 1836 | 1871 |
| 1837 | 1872 |
| 1838 unittest.group("resource-DefaultObjectAccessControlsResourceApi", () { | 1873 unittest.group("resource-DefaultObjectAccessControlsResourceApi", () { |
| 1839 unittest.test("method--delete", () { | 1874 unittest.test("method--delete", () { |
| 1840 | 1875 |
| 1841 var mock = new common_test.HttpServerMock(); | 1876 var mock = new HttpServerMock(); |
| 1842 api.DefaultObjectAccessControlsResourceApi res = new api.StorageApi(mock).
defaultObjectAccessControls; | 1877 api.DefaultObjectAccessControlsResourceApi res = new api.StorageApi(mock).
defaultObjectAccessControls; |
| 1843 var arg_bucket = "foo"; | 1878 var arg_bucket = "foo"; |
| 1844 var arg_entity = "foo"; | 1879 var arg_entity = "foo"; |
| 1845 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1880 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1846 var path = (req.url).path; | 1881 var path = (req.url).path; |
| 1847 var pathOffset = 0; | 1882 var pathOffset = 0; |
| 1848 var index; | 1883 var index; |
| 1849 var subPart; | 1884 var subPart; |
| 1850 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1885 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1851 pathOffset += 1; | 1886 pathOffset += 1; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1879 var keyvalue = part.split("="); | 1914 var keyvalue = part.split("="); |
| 1880 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1915 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1881 } | 1916 } |
| 1882 } | 1917 } |
| 1883 | 1918 |
| 1884 | 1919 |
| 1885 var h = { | 1920 var h = { |
| 1886 "content-type" : "application/json; charset=utf-8", | 1921 "content-type" : "application/json; charset=utf-8", |
| 1887 }; | 1922 }; |
| 1888 var resp = ""; | 1923 var resp = ""; |
| 1889 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1924 return new async.Future.value(stringResponse(200, h, resp)); |
| 1890 }), true); | 1925 }), true); |
| 1891 res.delete(arg_bucket, arg_entity).then(unittest.expectAsync((_) {})); | 1926 res.delete(arg_bucket, arg_entity).then(unittest.expectAsync((_) {})); |
| 1892 }); | 1927 }); |
| 1893 | 1928 |
| 1894 unittest.test("method--get", () { | 1929 unittest.test("method--get", () { |
| 1895 | 1930 |
| 1896 var mock = new common_test.HttpServerMock(); | 1931 var mock = new HttpServerMock(); |
| 1897 api.DefaultObjectAccessControlsResourceApi res = new api.StorageApi(mock).
defaultObjectAccessControls; | 1932 api.DefaultObjectAccessControlsResourceApi res = new api.StorageApi(mock).
defaultObjectAccessControls; |
| 1898 var arg_bucket = "foo"; | 1933 var arg_bucket = "foo"; |
| 1899 var arg_entity = "foo"; | 1934 var arg_entity = "foo"; |
| 1900 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1935 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1901 var path = (req.url).path; | 1936 var path = (req.url).path; |
| 1902 var pathOffset = 0; | 1937 var pathOffset = 0; |
| 1903 var index; | 1938 var index; |
| 1904 var subPart; | 1939 var subPart; |
| 1905 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1940 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1906 pathOffset += 1; | 1941 pathOffset += 1; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1934 var keyvalue = part.split("="); | 1969 var keyvalue = part.split("="); |
| 1935 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1970 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1936 } | 1971 } |
| 1937 } | 1972 } |
| 1938 | 1973 |
| 1939 | 1974 |
| 1940 var h = { | 1975 var h = { |
| 1941 "content-type" : "application/json; charset=utf-8", | 1976 "content-type" : "application/json; charset=utf-8", |
| 1942 }; | 1977 }; |
| 1943 var resp = convert.JSON.encode(buildObjectAccessControl()); | 1978 var resp = convert.JSON.encode(buildObjectAccessControl()); |
| 1944 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1979 return new async.Future.value(stringResponse(200, h, resp)); |
| 1945 }), true); | 1980 }), true); |
| 1946 res.get(arg_bucket, arg_entity).then(unittest.expectAsync(((api.ObjectAcce
ssControl response) { | 1981 res.get(arg_bucket, arg_entity).then(unittest.expectAsync(((api.ObjectAcce
ssControl response) { |
| 1947 checkObjectAccessControl(response); | 1982 checkObjectAccessControl(response); |
| 1948 }))); | 1983 }))); |
| 1949 }); | 1984 }); |
| 1950 | 1985 |
| 1951 unittest.test("method--insert", () { | 1986 unittest.test("method--insert", () { |
| 1952 | 1987 |
| 1953 var mock = new common_test.HttpServerMock(); | 1988 var mock = new HttpServerMock(); |
| 1954 api.DefaultObjectAccessControlsResourceApi res = new api.StorageApi(mock).
defaultObjectAccessControls; | 1989 api.DefaultObjectAccessControlsResourceApi res = new api.StorageApi(mock).
defaultObjectAccessControls; |
| 1955 var arg_request = buildObjectAccessControl(); | 1990 var arg_request = buildObjectAccessControl(); |
| 1956 var arg_bucket = "foo"; | 1991 var arg_bucket = "foo"; |
| 1957 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1992 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1958 var obj = new api.ObjectAccessControl.fromJson(json); | 1993 var obj = new api.ObjectAccessControl.fromJson(json); |
| 1959 checkObjectAccessControl(obj); | 1994 checkObjectAccessControl(obj); |
| 1960 | 1995 |
| 1961 var path = (req.url).path; | 1996 var path = (req.url).path; |
| 1962 var pathOffset = 0; | 1997 var pathOffset = 0; |
| 1963 var index; | 1998 var index; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1991 var keyvalue = part.split("="); | 2026 var keyvalue = part.split("="); |
| 1992 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2027 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1993 } | 2028 } |
| 1994 } | 2029 } |
| 1995 | 2030 |
| 1996 | 2031 |
| 1997 var h = { | 2032 var h = { |
| 1998 "content-type" : "application/json; charset=utf-8", | 2033 "content-type" : "application/json; charset=utf-8", |
| 1999 }; | 2034 }; |
| 2000 var resp = convert.JSON.encode(buildObjectAccessControl()); | 2035 var resp = convert.JSON.encode(buildObjectAccessControl()); |
| 2001 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2036 return new async.Future.value(stringResponse(200, h, resp)); |
| 2002 }), true); | 2037 }), true); |
| 2003 res.insert(arg_request, arg_bucket).then(unittest.expectAsync(((api.Object
AccessControl response) { | 2038 res.insert(arg_request, arg_bucket).then(unittest.expectAsync(((api.Object
AccessControl response) { |
| 2004 checkObjectAccessControl(response); | 2039 checkObjectAccessControl(response); |
| 2005 }))); | 2040 }))); |
| 2006 }); | 2041 }); |
| 2007 | 2042 |
| 2008 unittest.test("method--list", () { | 2043 unittest.test("method--list", () { |
| 2009 | 2044 |
| 2010 var mock = new common_test.HttpServerMock(); | 2045 var mock = new HttpServerMock(); |
| 2011 api.DefaultObjectAccessControlsResourceApi res = new api.StorageApi(mock).
defaultObjectAccessControls; | 2046 api.DefaultObjectAccessControlsResourceApi res = new api.StorageApi(mock).
defaultObjectAccessControls; |
| 2012 var arg_bucket = "foo"; | 2047 var arg_bucket = "foo"; |
| 2013 var arg_ifMetagenerationMatch = "foo"; | 2048 var arg_ifMetagenerationMatch = "foo"; |
| 2014 var arg_ifMetagenerationNotMatch = "foo"; | 2049 var arg_ifMetagenerationNotMatch = "foo"; |
| 2015 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2050 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2016 var path = (req.url).path; | 2051 var path = (req.url).path; |
| 2017 var pathOffset = 0; | 2052 var pathOffset = 0; |
| 2018 var index; | 2053 var index; |
| 2019 var subPart; | 2054 var subPart; |
| 2020 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2055 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2048 } | 2083 } |
| 2049 } | 2084 } |
| 2050 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); | 2085 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); |
| 2051 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); | 2086 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); |
| 2052 | 2087 |
| 2053 | 2088 |
| 2054 var h = { | 2089 var h = { |
| 2055 "content-type" : "application/json; charset=utf-8", | 2090 "content-type" : "application/json; charset=utf-8", |
| 2056 }; | 2091 }; |
| 2057 var resp = convert.JSON.encode(buildObjectAccessControls()); | 2092 var resp = convert.JSON.encode(buildObjectAccessControls()); |
| 2058 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2093 return new async.Future.value(stringResponse(200, h, resp)); |
| 2059 }), true); | 2094 }), true); |
| 2060 res.list(arg_bucket, ifMetagenerationMatch: arg_ifMetagenerationMatch, ifM
etagenerationNotMatch: arg_ifMetagenerationNotMatch).then(unittest.expectAsync((
(api.ObjectAccessControls response) { | 2095 res.list(arg_bucket, ifMetagenerationMatch: arg_ifMetagenerationMatch, ifM
etagenerationNotMatch: arg_ifMetagenerationNotMatch).then(unittest.expectAsync((
(api.ObjectAccessControls response) { |
| 2061 checkObjectAccessControls(response); | 2096 checkObjectAccessControls(response); |
| 2062 }))); | 2097 }))); |
| 2063 }); | 2098 }); |
| 2064 | 2099 |
| 2065 unittest.test("method--patch", () { | 2100 unittest.test("method--patch", () { |
| 2066 | 2101 |
| 2067 var mock = new common_test.HttpServerMock(); | 2102 var mock = new HttpServerMock(); |
| 2068 api.DefaultObjectAccessControlsResourceApi res = new api.StorageApi(mock).
defaultObjectAccessControls; | 2103 api.DefaultObjectAccessControlsResourceApi res = new api.StorageApi(mock).
defaultObjectAccessControls; |
| 2069 var arg_request = buildObjectAccessControl(); | 2104 var arg_request = buildObjectAccessControl(); |
| 2070 var arg_bucket = "foo"; | 2105 var arg_bucket = "foo"; |
| 2071 var arg_entity = "foo"; | 2106 var arg_entity = "foo"; |
| 2072 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2107 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2073 var obj = new api.ObjectAccessControl.fromJson(json); | 2108 var obj = new api.ObjectAccessControl.fromJson(json); |
| 2074 checkObjectAccessControl(obj); | 2109 checkObjectAccessControl(obj); |
| 2075 | 2110 |
| 2076 var path = (req.url).path; | 2111 var path = (req.url).path; |
| 2077 var pathOffset = 0; | 2112 var pathOffset = 0; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2109 var keyvalue = part.split("="); | 2144 var keyvalue = part.split("="); |
| 2110 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2145 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2111 } | 2146 } |
| 2112 } | 2147 } |
| 2113 | 2148 |
| 2114 | 2149 |
| 2115 var h = { | 2150 var h = { |
| 2116 "content-type" : "application/json; charset=utf-8", | 2151 "content-type" : "application/json; charset=utf-8", |
| 2117 }; | 2152 }; |
| 2118 var resp = convert.JSON.encode(buildObjectAccessControl()); | 2153 var resp = convert.JSON.encode(buildObjectAccessControl()); |
| 2119 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2154 return new async.Future.value(stringResponse(200, h, resp)); |
| 2120 }), true); | 2155 }), true); |
| 2121 res.patch(arg_request, arg_bucket, arg_entity).then(unittest.expectAsync((
(api.ObjectAccessControl response) { | 2156 res.patch(arg_request, arg_bucket, arg_entity).then(unittest.expectAsync((
(api.ObjectAccessControl response) { |
| 2122 checkObjectAccessControl(response); | 2157 checkObjectAccessControl(response); |
| 2123 }))); | 2158 }))); |
| 2124 }); | 2159 }); |
| 2125 | 2160 |
| 2126 unittest.test("method--update", () { | 2161 unittest.test("method--update", () { |
| 2127 | 2162 |
| 2128 var mock = new common_test.HttpServerMock(); | 2163 var mock = new HttpServerMock(); |
| 2129 api.DefaultObjectAccessControlsResourceApi res = new api.StorageApi(mock).
defaultObjectAccessControls; | 2164 api.DefaultObjectAccessControlsResourceApi res = new api.StorageApi(mock).
defaultObjectAccessControls; |
| 2130 var arg_request = buildObjectAccessControl(); | 2165 var arg_request = buildObjectAccessControl(); |
| 2131 var arg_bucket = "foo"; | 2166 var arg_bucket = "foo"; |
| 2132 var arg_entity = "foo"; | 2167 var arg_entity = "foo"; |
| 2133 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2168 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2134 var obj = new api.ObjectAccessControl.fromJson(json); | 2169 var obj = new api.ObjectAccessControl.fromJson(json); |
| 2135 checkObjectAccessControl(obj); | 2170 checkObjectAccessControl(obj); |
| 2136 | 2171 |
| 2137 var path = (req.url).path; | 2172 var path = (req.url).path; |
| 2138 var pathOffset = 0; | 2173 var pathOffset = 0; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2170 var keyvalue = part.split("="); | 2205 var keyvalue = part.split("="); |
| 2171 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2206 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2172 } | 2207 } |
| 2173 } | 2208 } |
| 2174 | 2209 |
| 2175 | 2210 |
| 2176 var h = { | 2211 var h = { |
| 2177 "content-type" : "application/json; charset=utf-8", | 2212 "content-type" : "application/json; charset=utf-8", |
| 2178 }; | 2213 }; |
| 2179 var resp = convert.JSON.encode(buildObjectAccessControl()); | 2214 var resp = convert.JSON.encode(buildObjectAccessControl()); |
| 2180 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2215 return new async.Future.value(stringResponse(200, h, resp)); |
| 2181 }), true); | 2216 }), true); |
| 2182 res.update(arg_request, arg_bucket, arg_entity).then(unittest.expectAsync(
((api.ObjectAccessControl response) { | 2217 res.update(arg_request, arg_bucket, arg_entity).then(unittest.expectAsync(
((api.ObjectAccessControl response) { |
| 2183 checkObjectAccessControl(response); | 2218 checkObjectAccessControl(response); |
| 2184 }))); | 2219 }))); |
| 2185 }); | 2220 }); |
| 2186 | 2221 |
| 2187 }); | 2222 }); |
| 2188 | 2223 |
| 2189 | 2224 |
| 2190 unittest.group("resource-ObjectAccessControlsResourceApi", () { | 2225 unittest.group("resource-ObjectAccessControlsResourceApi", () { |
| 2191 unittest.test("method--delete", () { | 2226 unittest.test("method--delete", () { |
| 2192 | 2227 |
| 2193 var mock = new common_test.HttpServerMock(); | 2228 var mock = new HttpServerMock(); |
| 2194 api.ObjectAccessControlsResourceApi res = new api.StorageApi(mock).objectA
ccessControls; | 2229 api.ObjectAccessControlsResourceApi res = new api.StorageApi(mock).objectA
ccessControls; |
| 2195 var arg_bucket = "foo"; | 2230 var arg_bucket = "foo"; |
| 2196 var arg_object = "foo"; | 2231 var arg_object = "foo"; |
| 2197 var arg_entity = "foo"; | 2232 var arg_entity = "foo"; |
| 2198 var arg_generation = "foo"; | 2233 var arg_generation = "foo"; |
| 2199 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2234 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2200 var path = (req.url).path; | 2235 var path = (req.url).path; |
| 2201 var pathOffset = 0; | 2236 var pathOffset = 0; |
| 2202 var index; | 2237 var index; |
| 2203 var subPart; | 2238 var subPart; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2241 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2276 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2242 } | 2277 } |
| 2243 } | 2278 } |
| 2244 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); | 2279 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); |
| 2245 | 2280 |
| 2246 | 2281 |
| 2247 var h = { | 2282 var h = { |
| 2248 "content-type" : "application/json; charset=utf-8", | 2283 "content-type" : "application/json; charset=utf-8", |
| 2249 }; | 2284 }; |
| 2250 var resp = ""; | 2285 var resp = ""; |
| 2251 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2286 return new async.Future.value(stringResponse(200, h, resp)); |
| 2252 }), true); | 2287 }), true); |
| 2253 res.delete(arg_bucket, arg_object, arg_entity, generation: arg_generation)
.then(unittest.expectAsync((_) {})); | 2288 res.delete(arg_bucket, arg_object, arg_entity, generation: arg_generation)
.then(unittest.expectAsync((_) {})); |
| 2254 }); | 2289 }); |
| 2255 | 2290 |
| 2256 unittest.test("method--get", () { | 2291 unittest.test("method--get", () { |
| 2257 | 2292 |
| 2258 var mock = new common_test.HttpServerMock(); | 2293 var mock = new HttpServerMock(); |
| 2259 api.ObjectAccessControlsResourceApi res = new api.StorageApi(mock).objectA
ccessControls; | 2294 api.ObjectAccessControlsResourceApi res = new api.StorageApi(mock).objectA
ccessControls; |
| 2260 var arg_bucket = "foo"; | 2295 var arg_bucket = "foo"; |
| 2261 var arg_object = "foo"; | 2296 var arg_object = "foo"; |
| 2262 var arg_entity = "foo"; | 2297 var arg_entity = "foo"; |
| 2263 var arg_generation = "foo"; | 2298 var arg_generation = "foo"; |
| 2264 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2299 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2265 var path = (req.url).path; | 2300 var path = (req.url).path; |
| 2266 var pathOffset = 0; | 2301 var pathOffset = 0; |
| 2267 var index; | 2302 var index; |
| 2268 var subPart; | 2303 var subPart; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2306 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2341 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2307 } | 2342 } |
| 2308 } | 2343 } |
| 2309 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); | 2344 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); |
| 2310 | 2345 |
| 2311 | 2346 |
| 2312 var h = { | 2347 var h = { |
| 2313 "content-type" : "application/json; charset=utf-8", | 2348 "content-type" : "application/json; charset=utf-8", |
| 2314 }; | 2349 }; |
| 2315 var resp = convert.JSON.encode(buildObjectAccessControl()); | 2350 var resp = convert.JSON.encode(buildObjectAccessControl()); |
| 2316 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2351 return new async.Future.value(stringResponse(200, h, resp)); |
| 2317 }), true); | 2352 }), true); |
| 2318 res.get(arg_bucket, arg_object, arg_entity, generation: arg_generation).th
en(unittest.expectAsync(((api.ObjectAccessControl response) { | 2353 res.get(arg_bucket, arg_object, arg_entity, generation: arg_generation).th
en(unittest.expectAsync(((api.ObjectAccessControl response) { |
| 2319 checkObjectAccessControl(response); | 2354 checkObjectAccessControl(response); |
| 2320 }))); | 2355 }))); |
| 2321 }); | 2356 }); |
| 2322 | 2357 |
| 2323 unittest.test("method--insert", () { | 2358 unittest.test("method--insert", () { |
| 2324 | 2359 |
| 2325 var mock = new common_test.HttpServerMock(); | 2360 var mock = new HttpServerMock(); |
| 2326 api.ObjectAccessControlsResourceApi res = new api.StorageApi(mock).objectA
ccessControls; | 2361 api.ObjectAccessControlsResourceApi res = new api.StorageApi(mock).objectA
ccessControls; |
| 2327 var arg_request = buildObjectAccessControl(); | 2362 var arg_request = buildObjectAccessControl(); |
| 2328 var arg_bucket = "foo"; | 2363 var arg_bucket = "foo"; |
| 2329 var arg_object = "foo"; | 2364 var arg_object = "foo"; |
| 2330 var arg_generation = "foo"; | 2365 var arg_generation = "foo"; |
| 2331 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2366 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2332 var obj = new api.ObjectAccessControl.fromJson(json); | 2367 var obj = new api.ObjectAccessControl.fromJson(json); |
| 2333 checkObjectAccessControl(obj); | 2368 checkObjectAccessControl(obj); |
| 2334 | 2369 |
| 2335 var path = (req.url).path; | 2370 var path = (req.url).path; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2373 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2408 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2374 } | 2409 } |
| 2375 } | 2410 } |
| 2376 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); | 2411 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); |
| 2377 | 2412 |
| 2378 | 2413 |
| 2379 var h = { | 2414 var h = { |
| 2380 "content-type" : "application/json; charset=utf-8", | 2415 "content-type" : "application/json; charset=utf-8", |
| 2381 }; | 2416 }; |
| 2382 var resp = convert.JSON.encode(buildObjectAccessControl()); | 2417 var resp = convert.JSON.encode(buildObjectAccessControl()); |
| 2383 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2418 return new async.Future.value(stringResponse(200, h, resp)); |
| 2384 }), true); | 2419 }), true); |
| 2385 res.insert(arg_request, arg_bucket, arg_object, generation: arg_generation
).then(unittest.expectAsync(((api.ObjectAccessControl response) { | 2420 res.insert(arg_request, arg_bucket, arg_object, generation: arg_generation
).then(unittest.expectAsync(((api.ObjectAccessControl response) { |
| 2386 checkObjectAccessControl(response); | 2421 checkObjectAccessControl(response); |
| 2387 }))); | 2422 }))); |
| 2388 }); | 2423 }); |
| 2389 | 2424 |
| 2390 unittest.test("method--list", () { | 2425 unittest.test("method--list", () { |
| 2391 | 2426 |
| 2392 var mock = new common_test.HttpServerMock(); | 2427 var mock = new HttpServerMock(); |
| 2393 api.ObjectAccessControlsResourceApi res = new api.StorageApi(mock).objectA
ccessControls; | 2428 api.ObjectAccessControlsResourceApi res = new api.StorageApi(mock).objectA
ccessControls; |
| 2394 var arg_bucket = "foo"; | 2429 var arg_bucket = "foo"; |
| 2395 var arg_object = "foo"; | 2430 var arg_object = "foo"; |
| 2396 var arg_generation = "foo"; | 2431 var arg_generation = "foo"; |
| 2397 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2432 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2398 var path = (req.url).path; | 2433 var path = (req.url).path; |
| 2399 var pathOffset = 0; | 2434 var pathOffset = 0; |
| 2400 var index; | 2435 var index; |
| 2401 var subPart; | 2436 var subPart; |
| 2402 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2437 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2436 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2471 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2437 } | 2472 } |
| 2438 } | 2473 } |
| 2439 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); | 2474 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); |
| 2440 | 2475 |
| 2441 | 2476 |
| 2442 var h = { | 2477 var h = { |
| 2443 "content-type" : "application/json; charset=utf-8", | 2478 "content-type" : "application/json; charset=utf-8", |
| 2444 }; | 2479 }; |
| 2445 var resp = convert.JSON.encode(buildObjectAccessControls()); | 2480 var resp = convert.JSON.encode(buildObjectAccessControls()); |
| 2446 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2481 return new async.Future.value(stringResponse(200, h, resp)); |
| 2447 }), true); | 2482 }), true); |
| 2448 res.list(arg_bucket, arg_object, generation: arg_generation).then(unittest
.expectAsync(((api.ObjectAccessControls response) { | 2483 res.list(arg_bucket, arg_object, generation: arg_generation).then(unittest
.expectAsync(((api.ObjectAccessControls response) { |
| 2449 checkObjectAccessControls(response); | 2484 checkObjectAccessControls(response); |
| 2450 }))); | 2485 }))); |
| 2451 }); | 2486 }); |
| 2452 | 2487 |
| 2453 unittest.test("method--patch", () { | 2488 unittest.test("method--patch", () { |
| 2454 | 2489 |
| 2455 var mock = new common_test.HttpServerMock(); | 2490 var mock = new HttpServerMock(); |
| 2456 api.ObjectAccessControlsResourceApi res = new api.StorageApi(mock).objectA
ccessControls; | 2491 api.ObjectAccessControlsResourceApi res = new api.StorageApi(mock).objectA
ccessControls; |
| 2457 var arg_request = buildObjectAccessControl(); | 2492 var arg_request = buildObjectAccessControl(); |
| 2458 var arg_bucket = "foo"; | 2493 var arg_bucket = "foo"; |
| 2459 var arg_object = "foo"; | 2494 var arg_object = "foo"; |
| 2460 var arg_entity = "foo"; | 2495 var arg_entity = "foo"; |
| 2461 var arg_generation = "foo"; | 2496 var arg_generation = "foo"; |
| 2462 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2497 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2463 var obj = new api.ObjectAccessControl.fromJson(json); | 2498 var obj = new api.ObjectAccessControl.fromJson(json); |
| 2464 checkObjectAccessControl(obj); | 2499 checkObjectAccessControl(obj); |
| 2465 | 2500 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2507 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2542 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2508 } | 2543 } |
| 2509 } | 2544 } |
| 2510 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); | 2545 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); |
| 2511 | 2546 |
| 2512 | 2547 |
| 2513 var h = { | 2548 var h = { |
| 2514 "content-type" : "application/json; charset=utf-8", | 2549 "content-type" : "application/json; charset=utf-8", |
| 2515 }; | 2550 }; |
| 2516 var resp = convert.JSON.encode(buildObjectAccessControl()); | 2551 var resp = convert.JSON.encode(buildObjectAccessControl()); |
| 2517 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2552 return new async.Future.value(stringResponse(200, h, resp)); |
| 2518 }), true); | 2553 }), true); |
| 2519 res.patch(arg_request, arg_bucket, arg_object, arg_entity, generation: arg
_generation).then(unittest.expectAsync(((api.ObjectAccessControl response) { | 2554 res.patch(arg_request, arg_bucket, arg_object, arg_entity, generation: arg
_generation).then(unittest.expectAsync(((api.ObjectAccessControl response) { |
| 2520 checkObjectAccessControl(response); | 2555 checkObjectAccessControl(response); |
| 2521 }))); | 2556 }))); |
| 2522 }); | 2557 }); |
| 2523 | 2558 |
| 2524 unittest.test("method--update", () { | 2559 unittest.test("method--update", () { |
| 2525 | 2560 |
| 2526 var mock = new common_test.HttpServerMock(); | 2561 var mock = new HttpServerMock(); |
| 2527 api.ObjectAccessControlsResourceApi res = new api.StorageApi(mock).objectA
ccessControls; | 2562 api.ObjectAccessControlsResourceApi res = new api.StorageApi(mock).objectA
ccessControls; |
| 2528 var arg_request = buildObjectAccessControl(); | 2563 var arg_request = buildObjectAccessControl(); |
| 2529 var arg_bucket = "foo"; | 2564 var arg_bucket = "foo"; |
| 2530 var arg_object = "foo"; | 2565 var arg_object = "foo"; |
| 2531 var arg_entity = "foo"; | 2566 var arg_entity = "foo"; |
| 2532 var arg_generation = "foo"; | 2567 var arg_generation = "foo"; |
| 2533 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2568 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2534 var obj = new api.ObjectAccessControl.fromJson(json); | 2569 var obj = new api.ObjectAccessControl.fromJson(json); |
| 2535 checkObjectAccessControl(obj); | 2570 checkObjectAccessControl(obj); |
| 2536 | 2571 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2578 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2613 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2579 } | 2614 } |
| 2580 } | 2615 } |
| 2581 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); | 2616 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); |
| 2582 | 2617 |
| 2583 | 2618 |
| 2584 var h = { | 2619 var h = { |
| 2585 "content-type" : "application/json; charset=utf-8", | 2620 "content-type" : "application/json; charset=utf-8", |
| 2586 }; | 2621 }; |
| 2587 var resp = convert.JSON.encode(buildObjectAccessControl()); | 2622 var resp = convert.JSON.encode(buildObjectAccessControl()); |
| 2588 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2623 return new async.Future.value(stringResponse(200, h, resp)); |
| 2589 }), true); | 2624 }), true); |
| 2590 res.update(arg_request, arg_bucket, arg_object, arg_entity, generation: ar
g_generation).then(unittest.expectAsync(((api.ObjectAccessControl response) { | 2625 res.update(arg_request, arg_bucket, arg_object, arg_entity, generation: ar
g_generation).then(unittest.expectAsync(((api.ObjectAccessControl response) { |
| 2591 checkObjectAccessControl(response); | 2626 checkObjectAccessControl(response); |
| 2592 }))); | 2627 }))); |
| 2593 }); | 2628 }); |
| 2594 | 2629 |
| 2595 }); | 2630 }); |
| 2596 | 2631 |
| 2597 | 2632 |
| 2598 unittest.group("resource-ObjectsResourceApi", () { | 2633 unittest.group("resource-ObjectsResourceApi", () { |
| 2599 unittest.test("method--compose", () { | 2634 unittest.test("method--compose", () { |
| 2600 // TODO: Implement tests for media upload; | 2635 // TODO: Implement tests for media upload; |
| 2601 // TODO: Implement tests for media download; | 2636 // TODO: Implement tests for media download; |
| 2602 | 2637 |
| 2603 var mock = new common_test.HttpServerMock(); | 2638 var mock = new HttpServerMock(); |
| 2604 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; | 2639 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; |
| 2605 var arg_request = buildComposeRequest(); | 2640 var arg_request = buildComposeRequest(); |
| 2606 var arg_destinationBucket = "foo"; | 2641 var arg_destinationBucket = "foo"; |
| 2607 var arg_destinationObject = "foo"; | 2642 var arg_destinationObject = "foo"; |
| 2608 var arg_destinationPredefinedAcl = "foo"; | 2643 var arg_destinationPredefinedAcl = "foo"; |
| 2644 var arg_encryptionAlgorithm = "foo"; |
| 2645 var arg_encryptionKey = "foo"; |
| 2646 var arg_encryptionKeyHash = "foo"; |
| 2609 var arg_ifGenerationMatch = "foo"; | 2647 var arg_ifGenerationMatch = "foo"; |
| 2610 var arg_ifMetagenerationMatch = "foo"; | 2648 var arg_ifMetagenerationMatch = "foo"; |
| 2611 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2649 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2612 var obj = new api.ComposeRequest.fromJson(json); | 2650 var obj = new api.ComposeRequest.fromJson(json); |
| 2613 checkComposeRequest(obj); | 2651 checkComposeRequest(obj); |
| 2614 | 2652 |
| 2615 var path = (req.url).path; | 2653 var path = (req.url).path; |
| 2616 var pathOffset = 0; | 2654 var pathOffset = 0; |
| 2617 var index; | 2655 var index; |
| 2618 var subPart; | 2656 var subPart; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2647 if (n == null) return null; | 2685 if (n == null) return null; |
| 2648 throw new core.ArgumentError("Invalid boolean: $n"); | 2686 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2649 } | 2687 } |
| 2650 if (query.length > 0) { | 2688 if (query.length > 0) { |
| 2651 for (var part in query.split("&")) { | 2689 for (var part in query.split("&")) { |
| 2652 var keyvalue = part.split("="); | 2690 var keyvalue = part.split("="); |
| 2653 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2691 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2654 } | 2692 } |
| 2655 } | 2693 } |
| 2656 unittest.expect(queryMap["destinationPredefinedAcl"].first, unittest.equ
als(arg_destinationPredefinedAcl)); | 2694 unittest.expect(queryMap["destinationPredefinedAcl"].first, unittest.equ
als(arg_destinationPredefinedAcl)); |
| 2695 unittest.expect(queryMap["encryptionAlgorithm"].first, unittest.equals(a
rg_encryptionAlgorithm)); |
| 2696 unittest.expect(queryMap["encryptionKey"].first, unittest.equals(arg_enc
ryptionKey)); |
| 2697 unittest.expect(queryMap["encryptionKeyHash"].first, unittest.equals(arg
_encryptionKeyHash)); |
| 2657 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); | 2698 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); |
| 2658 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); | 2699 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); |
| 2659 | 2700 |
| 2660 | 2701 |
| 2661 var h = { | 2702 var h = { |
| 2662 "content-type" : "application/json; charset=utf-8", | 2703 "content-type" : "application/json; charset=utf-8", |
| 2663 }; | 2704 }; |
| 2664 var resp = convert.JSON.encode(buildObject()); | 2705 var resp = convert.JSON.encode(buildObject()); |
| 2665 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2706 return new async.Future.value(stringResponse(200, h, resp)); |
| 2666 }), true); | 2707 }), true); |
| 2667 res.compose(arg_request, arg_destinationBucket, arg_destinationObject, des
tinationPredefinedAcl: arg_destinationPredefinedAcl, ifGenerationMatch: arg_ifGe
nerationMatch, ifMetagenerationMatch: arg_ifMetagenerationMatch).then(unittest.e
xpectAsync(((api.Object response) { | 2708 res.compose(arg_request, arg_destinationBucket, arg_destinationObject, des
tinationPredefinedAcl: arg_destinationPredefinedAcl, encryptionAlgorithm: arg_en
cryptionAlgorithm, encryptionKey: arg_encryptionKey, encryptionKeyHash: arg_encr
yptionKeyHash, ifGenerationMatch: arg_ifGenerationMatch, ifMetagenerationMatch:
arg_ifMetagenerationMatch).then(unittest.expectAsync(((api.Object response) { |
| 2668 checkObject(response); | 2709 checkObject(response); |
| 2669 }))); | 2710 }))); |
| 2670 }); | 2711 }); |
| 2671 | 2712 |
| 2672 unittest.test("method--copy", () { | 2713 unittest.test("method--copy", () { |
| 2673 // TODO: Implement tests for media upload; | 2714 // TODO: Implement tests for media upload; |
| 2674 // TODO: Implement tests for media download; | 2715 // TODO: Implement tests for media download; |
| 2675 | 2716 |
| 2676 var mock = new common_test.HttpServerMock(); | 2717 var mock = new HttpServerMock(); |
| 2677 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; | 2718 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; |
| 2678 var arg_request = buildObject(); | 2719 var arg_request = buildObject(); |
| 2679 var arg_sourceBucket = "foo"; | 2720 var arg_sourceBucket = "foo"; |
| 2680 var arg_sourceObject = "foo"; | 2721 var arg_sourceObject = "foo"; |
| 2681 var arg_destinationBucket = "foo"; | 2722 var arg_destinationBucket = "foo"; |
| 2682 var arg_destinationObject = "foo"; | 2723 var arg_destinationObject = "foo"; |
| 2683 var arg_destinationPredefinedAcl = "foo"; | 2724 var arg_destinationPredefinedAcl = "foo"; |
| 2725 var arg_encryptionAlgorithm = "foo"; |
| 2726 var arg_encryptionKey = "foo"; |
| 2727 var arg_encryptionKeyHash = "foo"; |
| 2684 var arg_ifGenerationMatch = "foo"; | 2728 var arg_ifGenerationMatch = "foo"; |
| 2685 var arg_ifGenerationNotMatch = "foo"; | 2729 var arg_ifGenerationNotMatch = "foo"; |
| 2686 var arg_ifMetagenerationMatch = "foo"; | 2730 var arg_ifMetagenerationMatch = "foo"; |
| 2687 var arg_ifMetagenerationNotMatch = "foo"; | 2731 var arg_ifMetagenerationNotMatch = "foo"; |
| 2688 var arg_ifSourceGenerationMatch = "foo"; | 2732 var arg_ifSourceGenerationMatch = "foo"; |
| 2689 var arg_ifSourceGenerationNotMatch = "foo"; | 2733 var arg_ifSourceGenerationNotMatch = "foo"; |
| 2690 var arg_ifSourceMetagenerationMatch = "foo"; | 2734 var arg_ifSourceMetagenerationMatch = "foo"; |
| 2691 var arg_ifSourceMetagenerationNotMatch = "foo"; | 2735 var arg_ifSourceMetagenerationNotMatch = "foo"; |
| 2692 var arg_projection = "foo"; | 2736 var arg_projection = "foo"; |
| 2693 var arg_sourceGeneration = "foo"; | 2737 var arg_sourceGeneration = "foo"; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2740 if (n == null) return null; | 2784 if (n == null) return null; |
| 2741 throw new core.ArgumentError("Invalid boolean: $n"); | 2785 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2742 } | 2786 } |
| 2743 if (query.length > 0) { | 2787 if (query.length > 0) { |
| 2744 for (var part in query.split("&")) { | 2788 for (var part in query.split("&")) { |
| 2745 var keyvalue = part.split("="); | 2789 var keyvalue = part.split("="); |
| 2746 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2790 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2747 } | 2791 } |
| 2748 } | 2792 } |
| 2749 unittest.expect(queryMap["destinationPredefinedAcl"].first, unittest.equ
als(arg_destinationPredefinedAcl)); | 2793 unittest.expect(queryMap["destinationPredefinedAcl"].first, unittest.equ
als(arg_destinationPredefinedAcl)); |
| 2794 unittest.expect(queryMap["encryptionAlgorithm"].first, unittest.equals(a
rg_encryptionAlgorithm)); |
| 2795 unittest.expect(queryMap["encryptionKey"].first, unittest.equals(arg_enc
ryptionKey)); |
| 2796 unittest.expect(queryMap["encryptionKeyHash"].first, unittest.equals(arg
_encryptionKeyHash)); |
| 2750 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); | 2797 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); |
| 2751 unittest.expect(queryMap["ifGenerationNotMatch"].first, unittest.equals(
arg_ifGenerationNotMatch)); | 2798 unittest.expect(queryMap["ifGenerationNotMatch"].first, unittest.equals(
arg_ifGenerationNotMatch)); |
| 2752 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); | 2799 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); |
| 2753 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); | 2800 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); |
| 2754 unittest.expect(queryMap["ifSourceGenerationMatch"].first, unittest.equa
ls(arg_ifSourceGenerationMatch)); | 2801 unittest.expect(queryMap["ifSourceGenerationMatch"].first, unittest.equa
ls(arg_ifSourceGenerationMatch)); |
| 2755 unittest.expect(queryMap["ifSourceGenerationNotMatch"].first, unittest.e
quals(arg_ifSourceGenerationNotMatch)); | 2802 unittest.expect(queryMap["ifSourceGenerationNotMatch"].first, unittest.e
quals(arg_ifSourceGenerationNotMatch)); |
| 2756 unittest.expect(queryMap["ifSourceMetagenerationMatch"].first, unittest.
equals(arg_ifSourceMetagenerationMatch)); | 2803 unittest.expect(queryMap["ifSourceMetagenerationMatch"].first, unittest.
equals(arg_ifSourceMetagenerationMatch)); |
| 2757 unittest.expect(queryMap["ifSourceMetagenerationNotMatch"].first, unitte
st.equals(arg_ifSourceMetagenerationNotMatch)); | 2804 unittest.expect(queryMap["ifSourceMetagenerationNotMatch"].first, unitte
st.equals(arg_ifSourceMetagenerationNotMatch)); |
| 2758 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | 2805 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); |
| 2759 unittest.expect(queryMap["sourceGeneration"].first, unittest.equals(arg_
sourceGeneration)); | 2806 unittest.expect(queryMap["sourceGeneration"].first, unittest.equals(arg_
sourceGeneration)); |
| 2760 | 2807 |
| 2761 | 2808 |
| 2762 var h = { | 2809 var h = { |
| 2763 "content-type" : "application/json; charset=utf-8", | 2810 "content-type" : "application/json; charset=utf-8", |
| 2764 }; | 2811 }; |
| 2765 var resp = convert.JSON.encode(buildObject()); | 2812 var resp = convert.JSON.encode(buildObject()); |
| 2766 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2813 return new async.Future.value(stringResponse(200, h, resp)); |
| 2767 }), true); | 2814 }), true); |
| 2768 res.copy(arg_request, arg_sourceBucket, arg_sourceObject, arg_destinationB
ucket, arg_destinationObject, destinationPredefinedAcl: arg_destinationPredefine
dAcl, ifGenerationMatch: arg_ifGenerationMatch, ifGenerationNotMatch: arg_ifGene
rationNotMatch, ifMetagenerationMatch: arg_ifMetagenerationMatch, ifMetagenerati
onNotMatch: arg_ifMetagenerationNotMatch, ifSourceGenerationMatch: arg_ifSourceG
enerationMatch, ifSourceGenerationNotMatch: arg_ifSourceGenerationNotMatch, ifSo
urceMetagenerationMatch: arg_ifSourceMetagenerationMatch, ifSourceMetageneration
NotMatch: arg_ifSourceMetagenerationNotMatch, projection: arg_projection, source
Generation: arg_sourceGeneration).then(unittest.expectAsync(((api.Object respons
e) { | 2815 res.copy(arg_request, arg_sourceBucket, arg_sourceObject, arg_destinationB
ucket, arg_destinationObject, destinationPredefinedAcl: arg_destinationPredefine
dAcl, encryptionAlgorithm: arg_encryptionAlgorithm, encryptionKey: arg_encryptio
nKey, encryptionKeyHash: arg_encryptionKeyHash, ifGenerationMatch: arg_ifGenerat
ionMatch, ifGenerationNotMatch: arg_ifGenerationNotMatch, ifMetagenerationMatch:
arg_ifMetagenerationMatch, ifMetagenerationNotMatch: arg_ifMetagenerationNotMat
ch, ifSourceGenerationMatch: arg_ifSourceGenerationMatch, ifSourceGenerationNotM
atch: arg_ifSourceGenerationNotMatch, ifSourceMetagenerationMatch: arg_ifSourceM
etagenerationMatch, ifSourceMetagenerationNotMatch: arg_ifSourceMetagenerationNo
tMatch, projection: arg_projection, sourceGeneration: arg_sourceGeneration).then
(unittest.expectAsync(((api.Object response) { |
| 2769 checkObject(response); | 2816 checkObject(response); |
| 2770 }))); | 2817 }))); |
| 2771 }); | 2818 }); |
| 2772 | 2819 |
| 2773 unittest.test("method--delete", () { | 2820 unittest.test("method--delete", () { |
| 2774 | 2821 |
| 2775 var mock = new common_test.HttpServerMock(); | 2822 var mock = new HttpServerMock(); |
| 2776 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; | 2823 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; |
| 2777 var arg_bucket = "foo"; | 2824 var arg_bucket = "foo"; |
| 2778 var arg_object = "foo"; | 2825 var arg_object = "foo"; |
| 2779 var arg_generation = "foo"; | 2826 var arg_generation = "foo"; |
| 2780 var arg_ifGenerationMatch = "foo"; | 2827 var arg_ifGenerationMatch = "foo"; |
| 2781 var arg_ifGenerationNotMatch = "foo"; | 2828 var arg_ifGenerationNotMatch = "foo"; |
| 2782 var arg_ifMetagenerationMatch = "foo"; | 2829 var arg_ifMetagenerationMatch = "foo"; |
| 2783 var arg_ifMetagenerationNotMatch = "foo"; | 2830 var arg_ifMetagenerationNotMatch = "foo"; |
| 2784 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2831 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2785 var path = (req.url).path; | 2832 var path = (req.url).path; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2823 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); | 2870 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); |
| 2824 unittest.expect(queryMap["ifGenerationNotMatch"].first, unittest.equals(
arg_ifGenerationNotMatch)); | 2871 unittest.expect(queryMap["ifGenerationNotMatch"].first, unittest.equals(
arg_ifGenerationNotMatch)); |
| 2825 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); | 2872 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); |
| 2826 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); | 2873 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); |
| 2827 | 2874 |
| 2828 | 2875 |
| 2829 var h = { | 2876 var h = { |
| 2830 "content-type" : "application/json; charset=utf-8", | 2877 "content-type" : "application/json; charset=utf-8", |
| 2831 }; | 2878 }; |
| 2832 var resp = ""; | 2879 var resp = ""; |
| 2833 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2880 return new async.Future.value(stringResponse(200, h, resp)); |
| 2834 }), true); | 2881 }), true); |
| 2835 res.delete(arg_bucket, arg_object, generation: arg_generation, ifGeneratio
nMatch: arg_ifGenerationMatch, ifGenerationNotMatch: arg_ifGenerationNotMatch, i
fMetagenerationMatch: arg_ifMetagenerationMatch, ifMetagenerationNotMatch: arg_i
fMetagenerationNotMatch).then(unittest.expectAsync((_) {})); | 2882 res.delete(arg_bucket, arg_object, generation: arg_generation, ifGeneratio
nMatch: arg_ifGenerationMatch, ifGenerationNotMatch: arg_ifGenerationNotMatch, i
fMetagenerationMatch: arg_ifMetagenerationMatch, ifMetagenerationNotMatch: arg_i
fMetagenerationNotMatch).then(unittest.expectAsync((_) {})); |
| 2836 }); | 2883 }); |
| 2837 | 2884 |
| 2838 unittest.test("method--get", () { | 2885 unittest.test("method--get", () { |
| 2839 // TODO: Implement tests for media upload; | 2886 // TODO: Implement tests for media upload; |
| 2840 // TODO: Implement tests for media download; | 2887 // TODO: Implement tests for media download; |
| 2841 | 2888 |
| 2842 var mock = new common_test.HttpServerMock(); | 2889 var mock = new HttpServerMock(); |
| 2843 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; | 2890 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; |
| 2844 var arg_bucket = "foo"; | 2891 var arg_bucket = "foo"; |
| 2845 var arg_object = "foo"; | 2892 var arg_object = "foo"; |
| 2893 var arg_encryptionAlgorithm = "foo"; |
| 2894 var arg_encryptionKey = "foo"; |
| 2895 var arg_encryptionKeyHash = "foo"; |
| 2846 var arg_generation = "foo"; | 2896 var arg_generation = "foo"; |
| 2847 var arg_ifGenerationMatch = "foo"; | 2897 var arg_ifGenerationMatch = "foo"; |
| 2848 var arg_ifGenerationNotMatch = "foo"; | 2898 var arg_ifGenerationNotMatch = "foo"; |
| 2849 var arg_ifMetagenerationMatch = "foo"; | 2899 var arg_ifMetagenerationMatch = "foo"; |
| 2850 var arg_ifMetagenerationNotMatch = "foo"; | 2900 var arg_ifMetagenerationNotMatch = "foo"; |
| 2851 var arg_projection = "foo"; | 2901 var arg_projection = "foo"; |
| 2852 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2902 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2853 var path = (req.url).path; | 2903 var path = (req.url).path; |
| 2854 var pathOffset = 0; | 2904 var pathOffset = 0; |
| 2855 var index; | 2905 var index; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 2880 if (n == "false") return false; | 2930 if (n == "false") return false; |
| 2881 if (n == null) return null; | 2931 if (n == null) return null; |
| 2882 throw new core.ArgumentError("Invalid boolean: $n"); | 2932 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2883 } | 2933 } |
| 2884 if (query.length > 0) { | 2934 if (query.length > 0) { |
| 2885 for (var part in query.split("&")) { | 2935 for (var part in query.split("&")) { |
| 2886 var keyvalue = part.split("="); | 2936 var keyvalue = part.split("="); |
| 2887 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2937 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2888 } | 2938 } |
| 2889 } | 2939 } |
| 2940 unittest.expect(queryMap["encryptionAlgorithm"].first, unittest.equals(a
rg_encryptionAlgorithm)); |
| 2941 unittest.expect(queryMap["encryptionKey"].first, unittest.equals(arg_enc
ryptionKey)); |
| 2942 unittest.expect(queryMap["encryptionKeyHash"].first, unittest.equals(arg
_encryptionKeyHash)); |
| 2890 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); | 2943 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); |
| 2891 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); | 2944 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); |
| 2892 unittest.expect(queryMap["ifGenerationNotMatch"].first, unittest.equals(
arg_ifGenerationNotMatch)); | 2945 unittest.expect(queryMap["ifGenerationNotMatch"].first, unittest.equals(
arg_ifGenerationNotMatch)); |
| 2893 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); | 2946 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); |
| 2894 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); | 2947 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); |
| 2895 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | 2948 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); |
| 2896 | 2949 |
| 2897 | 2950 |
| 2898 var h = { | 2951 var h = { |
| 2899 "content-type" : "application/json; charset=utf-8", | 2952 "content-type" : "application/json; charset=utf-8", |
| 2900 }; | 2953 }; |
| 2901 var resp = convert.JSON.encode(buildObject()); | 2954 var resp = convert.JSON.encode(buildObject()); |
| 2902 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 2955 return new async.Future.value(stringResponse(200, h, resp)); |
| 2903 }), true); | 2956 }), true); |
| 2904 res.get(arg_bucket, arg_object, generation: arg_generation, ifGenerationMa
tch: arg_ifGenerationMatch, ifGenerationNotMatch: arg_ifGenerationNotMatch, ifMe
tagenerationMatch: arg_ifMetagenerationMatch, ifMetagenerationNotMatch: arg_ifMe
tagenerationNotMatch, projection: arg_projection).then(unittest.expectAsync(((ap
i.Object response) { | 2957 res.get(arg_bucket, arg_object, encryptionAlgorithm: arg_encryptionAlgorit
hm, encryptionKey: arg_encryptionKey, encryptionKeyHash: arg_encryptionKeyHash,
generation: arg_generation, ifGenerationMatch: arg_ifGenerationMatch, ifGenerati
onNotMatch: arg_ifGenerationNotMatch, ifMetagenerationMatch: arg_ifMetageneratio
nMatch, ifMetagenerationNotMatch: arg_ifMetagenerationNotMatch, projection: arg_
projection).then(unittest.expectAsync(((api.Object response) { |
| 2905 checkObject(response); | 2958 checkObject(response); |
| 2906 }))); | 2959 }))); |
| 2907 }); | 2960 }); |
| 2908 | 2961 |
| 2909 unittest.test("method--insert", () { | 2962 unittest.test("method--insert", () { |
| 2910 // TODO: Implement tests for media upload; | 2963 // TODO: Implement tests for media upload; |
| 2911 // TODO: Implement tests for media download; | 2964 // TODO: Implement tests for media download; |
| 2912 | 2965 |
| 2913 var mock = new common_test.HttpServerMock(); | 2966 var mock = new HttpServerMock(); |
| 2914 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; | 2967 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; |
| 2915 var arg_request = buildObject(); | 2968 var arg_request = buildObject(); |
| 2916 var arg_bucket = "foo"; | 2969 var arg_bucket = "foo"; |
| 2917 var arg_contentEncoding = "foo"; | 2970 var arg_contentEncoding = "foo"; |
| 2971 var arg_encryptionAlgorithm = "foo"; |
| 2972 var arg_encryptionKey = "foo"; |
| 2973 var arg_encryptionKeyHash = "foo"; |
| 2918 var arg_ifGenerationMatch = "foo"; | 2974 var arg_ifGenerationMatch = "foo"; |
| 2919 var arg_ifGenerationNotMatch = "foo"; | 2975 var arg_ifGenerationNotMatch = "foo"; |
| 2920 var arg_ifMetagenerationMatch = "foo"; | 2976 var arg_ifMetagenerationMatch = "foo"; |
| 2921 var arg_ifMetagenerationNotMatch = "foo"; | 2977 var arg_ifMetagenerationNotMatch = "foo"; |
| 2922 var arg_name = "foo"; | 2978 var arg_name = "foo"; |
| 2923 var arg_predefinedAcl = "foo"; | 2979 var arg_predefinedAcl = "foo"; |
| 2924 var arg_projection = "foo"; | 2980 var arg_projection = "foo"; |
| 2925 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2981 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2926 var obj = new api.Object.fromJson(json); | 2982 var obj = new api.Object.fromJson(json); |
| 2927 checkObject(obj); | 2983 checkObject(obj); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 2954 if (n == null) return null; | 3010 if (n == null) return null; |
| 2955 throw new core.ArgumentError("Invalid boolean: $n"); | 3011 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2956 } | 3012 } |
| 2957 if (query.length > 0) { | 3013 if (query.length > 0) { |
| 2958 for (var part in query.split("&")) { | 3014 for (var part in query.split("&")) { |
| 2959 var keyvalue = part.split("="); | 3015 var keyvalue = part.split("="); |
| 2960 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3016 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2961 } | 3017 } |
| 2962 } | 3018 } |
| 2963 unittest.expect(queryMap["contentEncoding"].first, unittest.equals(arg_c
ontentEncoding)); | 3019 unittest.expect(queryMap["contentEncoding"].first, unittest.equals(arg_c
ontentEncoding)); |
| 3020 unittest.expect(queryMap["encryptionAlgorithm"].first, unittest.equals(a
rg_encryptionAlgorithm)); |
| 3021 unittest.expect(queryMap["encryptionKey"].first, unittest.equals(arg_enc
ryptionKey)); |
| 3022 unittest.expect(queryMap["encryptionKeyHash"].first, unittest.equals(arg
_encryptionKeyHash)); |
| 2964 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); | 3023 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); |
| 2965 unittest.expect(queryMap["ifGenerationNotMatch"].first, unittest.equals(
arg_ifGenerationNotMatch)); | 3024 unittest.expect(queryMap["ifGenerationNotMatch"].first, unittest.equals(
arg_ifGenerationNotMatch)); |
| 2966 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); | 3025 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); |
| 2967 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); | 3026 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); |
| 2968 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); | 3027 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); |
| 2969 unittest.expect(queryMap["predefinedAcl"].first, unittest.equals(arg_pre
definedAcl)); | 3028 unittest.expect(queryMap["predefinedAcl"].first, unittest.equals(arg_pre
definedAcl)); |
| 2970 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | 3029 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); |
| 2971 | 3030 |
| 2972 | 3031 |
| 2973 var h = { | 3032 var h = { |
| 2974 "content-type" : "application/json; charset=utf-8", | 3033 "content-type" : "application/json; charset=utf-8", |
| 2975 }; | 3034 }; |
| 2976 var resp = convert.JSON.encode(buildObject()); | 3035 var resp = convert.JSON.encode(buildObject()); |
| 2977 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3036 return new async.Future.value(stringResponse(200, h, resp)); |
| 2978 }), true); | 3037 }), true); |
| 2979 res.insert(arg_request, arg_bucket, contentEncoding: arg_contentEncoding,
ifGenerationMatch: arg_ifGenerationMatch, ifGenerationNotMatch: arg_ifGeneration
NotMatch, ifMetagenerationMatch: arg_ifMetagenerationMatch, ifMetagenerationNotM
atch: arg_ifMetagenerationNotMatch, name: arg_name, predefinedAcl: arg_predefine
dAcl, projection: arg_projection).then(unittest.expectAsync(((api.Object respons
e) { | 3038 res.insert(arg_request, arg_bucket, contentEncoding: arg_contentEncoding,
encryptionAlgorithm: arg_encryptionAlgorithm, encryptionKey: arg_encryptionKey,
encryptionKeyHash: arg_encryptionKeyHash, ifGenerationMatch: arg_ifGenerationMat
ch, ifGenerationNotMatch: arg_ifGenerationNotMatch, ifMetagenerationMatch: arg_i
fMetagenerationMatch, ifMetagenerationNotMatch: arg_ifMetagenerationNotMatch, na
me: arg_name, predefinedAcl: arg_predefinedAcl, projection: arg_projection).then
(unittest.expectAsync(((api.Object response) { |
| 2980 checkObject(response); | 3039 checkObject(response); |
| 2981 }))); | 3040 }))); |
| 2982 }); | 3041 }); |
| 2983 | 3042 |
| 2984 unittest.test("method--list", () { | 3043 unittest.test("method--list", () { |
| 2985 | 3044 |
| 2986 var mock = new common_test.HttpServerMock(); | 3045 var mock = new HttpServerMock(); |
| 2987 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; | 3046 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; |
| 2988 var arg_bucket = "foo"; | 3047 var arg_bucket = "foo"; |
| 2989 var arg_delimiter = "foo"; | 3048 var arg_delimiter = "foo"; |
| 2990 var arg_maxResults = 42; | 3049 var arg_maxResults = 42; |
| 2991 var arg_pageToken = "foo"; | 3050 var arg_pageToken = "foo"; |
| 2992 var arg_prefix = "foo"; | 3051 var arg_prefix = "foo"; |
| 2993 var arg_projection = "foo"; | 3052 var arg_projection = "foo"; |
| 2994 var arg_versions = true; | 3053 var arg_versions = true; |
| 2995 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3054 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2996 var path = (req.url).path; | 3055 var path = (req.url).path; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3032 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 3091 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 3033 unittest.expect(queryMap["prefix"].first, unittest.equals(arg_prefix)); | 3092 unittest.expect(queryMap["prefix"].first, unittest.equals(arg_prefix)); |
| 3034 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | 3093 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); |
| 3035 unittest.expect(queryMap["versions"].first, unittest.equals("$arg_versio
ns")); | 3094 unittest.expect(queryMap["versions"].first, unittest.equals("$arg_versio
ns")); |
| 3036 | 3095 |
| 3037 | 3096 |
| 3038 var h = { | 3097 var h = { |
| 3039 "content-type" : "application/json; charset=utf-8", | 3098 "content-type" : "application/json; charset=utf-8", |
| 3040 }; | 3099 }; |
| 3041 var resp = convert.JSON.encode(buildObjects()); | 3100 var resp = convert.JSON.encode(buildObjects()); |
| 3042 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3101 return new async.Future.value(stringResponse(200, h, resp)); |
| 3043 }), true); | 3102 }), true); |
| 3044 res.list(arg_bucket, delimiter: arg_delimiter, maxResults: arg_maxResults,
pageToken: arg_pageToken, prefix: arg_prefix, projection: arg_projection, versi
ons: arg_versions).then(unittest.expectAsync(((api.Objects response) { | 3103 res.list(arg_bucket, delimiter: arg_delimiter, maxResults: arg_maxResults,
pageToken: arg_pageToken, prefix: arg_prefix, projection: arg_projection, versi
ons: arg_versions).then(unittest.expectAsync(((api.Objects response) { |
| 3045 checkObjects(response); | 3104 checkObjects(response); |
| 3046 }))); | 3105 }))); |
| 3047 }); | 3106 }); |
| 3048 | 3107 |
| 3049 unittest.test("method--patch", () { | 3108 unittest.test("method--patch", () { |
| 3050 | 3109 |
| 3051 var mock = new common_test.HttpServerMock(); | 3110 var mock = new HttpServerMock(); |
| 3052 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; | 3111 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; |
| 3053 var arg_request = buildObject(); | 3112 var arg_request = buildObject(); |
| 3054 var arg_bucket = "foo"; | 3113 var arg_bucket = "foo"; |
| 3055 var arg_object = "foo"; | 3114 var arg_object = "foo"; |
| 3115 var arg_encryptionAlgorithm = "foo"; |
| 3116 var arg_encryptionKey = "foo"; |
| 3117 var arg_encryptionKeyHash = "foo"; |
| 3056 var arg_generation = "foo"; | 3118 var arg_generation = "foo"; |
| 3057 var arg_ifGenerationMatch = "foo"; | 3119 var arg_ifGenerationMatch = "foo"; |
| 3058 var arg_ifGenerationNotMatch = "foo"; | 3120 var arg_ifGenerationNotMatch = "foo"; |
| 3059 var arg_ifMetagenerationMatch = "foo"; | 3121 var arg_ifMetagenerationMatch = "foo"; |
| 3060 var arg_ifMetagenerationNotMatch = "foo"; | 3122 var arg_ifMetagenerationNotMatch = "foo"; |
| 3061 var arg_predefinedAcl = "foo"; | 3123 var arg_predefinedAcl = "foo"; |
| 3062 var arg_projection = "foo"; | 3124 var arg_projection = "foo"; |
| 3063 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3125 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 3064 var obj = new api.Object.fromJson(json); | 3126 var obj = new api.Object.fromJson(json); |
| 3065 checkObject(obj); | 3127 checkObject(obj); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 3094 if (n == "false") return false; | 3156 if (n == "false") return false; |
| 3095 if (n == null) return null; | 3157 if (n == null) return null; |
| 3096 throw new core.ArgumentError("Invalid boolean: $n"); | 3158 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3097 } | 3159 } |
| 3098 if (query.length > 0) { | 3160 if (query.length > 0) { |
| 3099 for (var part in query.split("&")) { | 3161 for (var part in query.split("&")) { |
| 3100 var keyvalue = part.split("="); | 3162 var keyvalue = part.split("="); |
| 3101 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3163 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 3102 } | 3164 } |
| 3103 } | 3165 } |
| 3166 unittest.expect(queryMap["encryptionAlgorithm"].first, unittest.equals(a
rg_encryptionAlgorithm)); |
| 3167 unittest.expect(queryMap["encryptionKey"].first, unittest.equals(arg_enc
ryptionKey)); |
| 3168 unittest.expect(queryMap["encryptionKeyHash"].first, unittest.equals(arg
_encryptionKeyHash)); |
| 3104 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); | 3169 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); |
| 3105 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); | 3170 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); |
| 3106 unittest.expect(queryMap["ifGenerationNotMatch"].first, unittest.equals(
arg_ifGenerationNotMatch)); | 3171 unittest.expect(queryMap["ifGenerationNotMatch"].first, unittest.equals(
arg_ifGenerationNotMatch)); |
| 3107 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); | 3172 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); |
| 3108 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); | 3173 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); |
| 3109 unittest.expect(queryMap["predefinedAcl"].first, unittest.equals(arg_pre
definedAcl)); | 3174 unittest.expect(queryMap["predefinedAcl"].first, unittest.equals(arg_pre
definedAcl)); |
| 3110 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | 3175 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); |
| 3111 | 3176 |
| 3112 | 3177 |
| 3113 var h = { | 3178 var h = { |
| 3114 "content-type" : "application/json; charset=utf-8", | 3179 "content-type" : "application/json; charset=utf-8", |
| 3115 }; | 3180 }; |
| 3116 var resp = convert.JSON.encode(buildObject()); | 3181 var resp = convert.JSON.encode(buildObject()); |
| 3117 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3182 return new async.Future.value(stringResponse(200, h, resp)); |
| 3118 }), true); | 3183 }), true); |
| 3119 res.patch(arg_request, arg_bucket, arg_object, generation: arg_generation,
ifGenerationMatch: arg_ifGenerationMatch, ifGenerationNotMatch: arg_ifGeneratio
nNotMatch, ifMetagenerationMatch: arg_ifMetagenerationMatch, ifMetagenerationNot
Match: arg_ifMetagenerationNotMatch, predefinedAcl: arg_predefinedAcl, projectio
n: arg_projection).then(unittest.expectAsync(((api.Object response) { | 3184 res.patch(arg_request, arg_bucket, arg_object, encryptionAlgorithm: arg_en
cryptionAlgorithm, encryptionKey: arg_encryptionKey, encryptionKeyHash: arg_encr
yptionKeyHash, generation: arg_generation, ifGenerationMatch: arg_ifGenerationMa
tch, ifGenerationNotMatch: arg_ifGenerationNotMatch, ifMetagenerationMatch: arg_
ifMetagenerationMatch, ifMetagenerationNotMatch: arg_ifMetagenerationNotMatch, p
redefinedAcl: arg_predefinedAcl, projection: arg_projection).then(unittest.expec
tAsync(((api.Object response) { |
| 3120 checkObject(response); | 3185 checkObject(response); |
| 3121 }))); | 3186 }))); |
| 3122 }); | 3187 }); |
| 3123 | 3188 |
| 3124 unittest.test("method--update", () { | 3189 unittest.test("method--update", () { |
| 3125 // TODO: Implement tests for media upload; | 3190 // TODO: Implement tests for media upload; |
| 3126 // TODO: Implement tests for media download; | 3191 // TODO: Implement tests for media download; |
| 3127 | 3192 |
| 3128 var mock = new common_test.HttpServerMock(); | 3193 var mock = new HttpServerMock(); |
| 3129 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; | 3194 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; |
| 3130 var arg_request = buildObject(); | 3195 var arg_request = buildObject(); |
| 3131 var arg_bucket = "foo"; | 3196 var arg_bucket = "foo"; |
| 3132 var arg_object = "foo"; | 3197 var arg_object = "foo"; |
| 3198 var arg_encryptionAlgorithm = "foo"; |
| 3199 var arg_encryptionKey = "foo"; |
| 3200 var arg_encryptionKeyHash = "foo"; |
| 3133 var arg_generation = "foo"; | 3201 var arg_generation = "foo"; |
| 3134 var arg_ifGenerationMatch = "foo"; | 3202 var arg_ifGenerationMatch = "foo"; |
| 3135 var arg_ifGenerationNotMatch = "foo"; | 3203 var arg_ifGenerationNotMatch = "foo"; |
| 3136 var arg_ifMetagenerationMatch = "foo"; | 3204 var arg_ifMetagenerationMatch = "foo"; |
| 3137 var arg_ifMetagenerationNotMatch = "foo"; | 3205 var arg_ifMetagenerationNotMatch = "foo"; |
| 3138 var arg_predefinedAcl = "foo"; | 3206 var arg_predefinedAcl = "foo"; |
| 3139 var arg_projection = "foo"; | 3207 var arg_projection = "foo"; |
| 3140 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3208 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 3141 var obj = new api.Object.fromJson(json); | 3209 var obj = new api.Object.fromJson(json); |
| 3142 checkObject(obj); | 3210 checkObject(obj); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 3171 if (n == "false") return false; | 3239 if (n == "false") return false; |
| 3172 if (n == null) return null; | 3240 if (n == null) return null; |
| 3173 throw new core.ArgumentError("Invalid boolean: $n"); | 3241 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3174 } | 3242 } |
| 3175 if (query.length > 0) { | 3243 if (query.length > 0) { |
| 3176 for (var part in query.split("&")) { | 3244 for (var part in query.split("&")) { |
| 3177 var keyvalue = part.split("="); | 3245 var keyvalue = part.split("="); |
| 3178 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3246 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 3179 } | 3247 } |
| 3180 } | 3248 } |
| 3249 unittest.expect(queryMap["encryptionAlgorithm"].first, unittest.equals(a
rg_encryptionAlgorithm)); |
| 3250 unittest.expect(queryMap["encryptionKey"].first, unittest.equals(arg_enc
ryptionKey)); |
| 3251 unittest.expect(queryMap["encryptionKeyHash"].first, unittest.equals(arg
_encryptionKeyHash)); |
| 3181 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); | 3252 unittest.expect(queryMap["generation"].first, unittest.equals(arg_genera
tion)); |
| 3182 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); | 3253 unittest.expect(queryMap["ifGenerationMatch"].first, unittest.equals(arg
_ifGenerationMatch)); |
| 3183 unittest.expect(queryMap["ifGenerationNotMatch"].first, unittest.equals(
arg_ifGenerationNotMatch)); | 3254 unittest.expect(queryMap["ifGenerationNotMatch"].first, unittest.equals(
arg_ifGenerationNotMatch)); |
| 3184 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); | 3255 unittest.expect(queryMap["ifMetagenerationMatch"].first, unittest.equals
(arg_ifMetagenerationMatch)); |
| 3185 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); | 3256 unittest.expect(queryMap["ifMetagenerationNotMatch"].first, unittest.equ
als(arg_ifMetagenerationNotMatch)); |
| 3186 unittest.expect(queryMap["predefinedAcl"].first, unittest.equals(arg_pre
definedAcl)); | 3257 unittest.expect(queryMap["predefinedAcl"].first, unittest.equals(arg_pre
definedAcl)); |
| 3187 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | 3258 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); |
| 3188 | 3259 |
| 3189 | 3260 |
| 3190 var h = { | 3261 var h = { |
| 3191 "content-type" : "application/json; charset=utf-8", | 3262 "content-type" : "application/json; charset=utf-8", |
| 3192 }; | 3263 }; |
| 3193 var resp = convert.JSON.encode(buildObject()); | 3264 var resp = convert.JSON.encode(buildObject()); |
| 3194 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3265 return new async.Future.value(stringResponse(200, h, resp)); |
| 3195 }), true); | 3266 }), true); |
| 3196 res.update(arg_request, arg_bucket, arg_object, generation: arg_generation
, ifGenerationMatch: arg_ifGenerationMatch, ifGenerationNotMatch: arg_ifGenerati
onNotMatch, ifMetagenerationMatch: arg_ifMetagenerationMatch, ifMetagenerationNo
tMatch: arg_ifMetagenerationNotMatch, predefinedAcl: arg_predefinedAcl, projecti
on: arg_projection).then(unittest.expectAsync(((api.Object response) { | 3267 res.update(arg_request, arg_bucket, arg_object, encryptionAlgorithm: arg_e
ncryptionAlgorithm, encryptionKey: arg_encryptionKey, encryptionKeyHash: arg_enc
ryptionKeyHash, generation: arg_generation, ifGenerationMatch: arg_ifGenerationM
atch, ifGenerationNotMatch: arg_ifGenerationNotMatch, ifMetagenerationMatch: arg
_ifMetagenerationMatch, ifMetagenerationNotMatch: arg_ifMetagenerationNotMatch,
predefinedAcl: arg_predefinedAcl, projection: arg_projection).then(unittest.expe
ctAsync(((api.Object response) { |
| 3197 checkObject(response); | 3268 checkObject(response); |
| 3198 }))); | 3269 }))); |
| 3199 }); | 3270 }); |
| 3200 | 3271 |
| 3201 unittest.test("method--watchAll", () { | 3272 unittest.test("method--watchAll", () { |
| 3202 | 3273 |
| 3203 var mock = new common_test.HttpServerMock(); | 3274 var mock = new HttpServerMock(); |
| 3204 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; | 3275 api.ObjectsResourceApi res = new api.StorageApi(mock).objects; |
| 3205 var arg_request = buildChannel(); | 3276 var arg_request = buildChannel(); |
| 3206 var arg_bucket = "foo"; | 3277 var arg_bucket = "foo"; |
| 3207 var arg_delimiter = "foo"; | 3278 var arg_delimiter = "foo"; |
| 3208 var arg_maxResults = 42; | 3279 var arg_maxResults = 42; |
| 3209 var arg_pageToken = "foo"; | 3280 var arg_pageToken = "foo"; |
| 3210 var arg_prefix = "foo"; | 3281 var arg_prefix = "foo"; |
| 3211 var arg_projection = "foo"; | 3282 var arg_projection = "foo"; |
| 3212 var arg_versions = true; | 3283 var arg_versions = true; |
| 3213 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3284 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3253 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 3324 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 3254 unittest.expect(queryMap["prefix"].first, unittest.equals(arg_prefix)); | 3325 unittest.expect(queryMap["prefix"].first, unittest.equals(arg_prefix)); |
| 3255 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); | 3326 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); |
| 3256 unittest.expect(queryMap["versions"].first, unittest.equals("$arg_versio
ns")); | 3327 unittest.expect(queryMap["versions"].first, unittest.equals("$arg_versio
ns")); |
| 3257 | 3328 |
| 3258 | 3329 |
| 3259 var h = { | 3330 var h = { |
| 3260 "content-type" : "application/json; charset=utf-8", | 3331 "content-type" : "application/json; charset=utf-8", |
| 3261 }; | 3332 }; |
| 3262 var resp = convert.JSON.encode(buildChannel()); | 3333 var resp = convert.JSON.encode(buildChannel()); |
| 3263 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 3334 return new async.Future.value(stringResponse(200, h, resp)); |
| 3264 }), true); | 3335 }), true); |
| 3265 res.watchAll(arg_request, arg_bucket, delimiter: arg_delimiter, maxResults
: arg_maxResults, pageToken: arg_pageToken, prefix: arg_prefix, projection: arg_
projection, versions: arg_versions).then(unittest.expectAsync(((api.Channel resp
onse) { | 3336 res.watchAll(arg_request, arg_bucket, delimiter: arg_delimiter, maxResults
: arg_maxResults, pageToken: arg_pageToken, prefix: arg_prefix, projection: arg_
projection, versions: arg_versions).then(unittest.expectAsync(((api.Channel resp
onse) { |
| 3266 checkChannel(response); | 3337 checkChannel(response); |
| 3267 }))); | 3338 }))); |
| 3268 }); | 3339 }); |
| 3269 | 3340 |
| 3270 }); | 3341 }); |
| 3271 | 3342 |
| 3272 | 3343 |
| 3273 } | 3344 } |
| 3274 | 3345 |
| OLD | NEW |