| OLD | NEW |
| 1 library googleapis.sourcerepo.v1.test; | 1 library googleapis.sourcerepo.v1.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:test/test.dart' as unittest; |
| 11 | 11 |
| 12 import 'package:googleapis/sourcerepo/v1.dart' as api; | 12 import 'package:googleapis/sourcerepo/v1.dart' as api; |
| 13 | 13 |
| 14 class HttpServerMock extends http.BaseClient { | 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; | 15 core.Function _callback; |
| 16 core.bool _expectJson; | 16 core.bool _expectJson; |
| 17 | 17 |
| 18 void register(core.Function callback, core.bool expectJson) { | 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; | 19 _callback = callback; |
| 20 _expectJson = expectJson; | 20 _expectJson = expectJson; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 39 } else { | 39 } else { |
| 40 return stream.toBytes().then((data) { | 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); | 41 return _callback(request, data); |
| 42 }); | 42 }); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 52 } |
| 53 | 53 |
| 54 buildUnnamed436() { | 54 buildUnnamed440() { |
| 55 var o = new core.List<api.AuditLogConfig>(); | 55 var o = new core.List<api.AuditLogConfig>(); |
| 56 o.add(buildAuditLogConfig()); | 56 o.add(buildAuditLogConfig()); |
| 57 o.add(buildAuditLogConfig()); | 57 o.add(buildAuditLogConfig()); |
| 58 return o; | 58 return o; |
| 59 } | 59 } |
| 60 | 60 |
| 61 checkUnnamed436(core.List<api.AuditLogConfig> o) { | 61 checkUnnamed440(core.List<api.AuditLogConfig> o) { |
| 62 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
| 63 checkAuditLogConfig(o[0]); | 63 checkAuditLogConfig(o[0]); |
| 64 checkAuditLogConfig(o[1]); | 64 checkAuditLogConfig(o[1]); |
| 65 } | 65 } |
| 66 | 66 |
| 67 buildUnnamed437() { | 67 buildUnnamed441() { |
| 68 var o = new core.List<core.String>(); | 68 var o = new core.List<core.String>(); |
| 69 o.add("foo"); | 69 o.add("foo"); |
| 70 o.add("foo"); | 70 o.add("foo"); |
| 71 return o; | 71 return o; |
| 72 } | 72 } |
| 73 | 73 |
| 74 checkUnnamed437(core.List<core.String> o) { | 74 checkUnnamed441(core.List<core.String> o) { |
| 75 unittest.expect(o, unittest.hasLength(2)); | 75 unittest.expect(o, unittest.hasLength(2)); |
| 76 unittest.expect(o[0], unittest.equals('foo')); | 76 unittest.expect(o[0], unittest.equals('foo')); |
| 77 unittest.expect(o[1], unittest.equals('foo')); | 77 unittest.expect(o[1], unittest.equals('foo')); |
| 78 } | 78 } |
| 79 | 79 |
| 80 core.int buildCounterAuditConfig = 0; | 80 core.int buildCounterAuditConfig = 0; |
| 81 buildAuditConfig() { | 81 buildAuditConfig() { |
| 82 var o = new api.AuditConfig(); | 82 var o = new api.AuditConfig(); |
| 83 buildCounterAuditConfig++; | 83 buildCounterAuditConfig++; |
| 84 if (buildCounterAuditConfig < 3) { | 84 if (buildCounterAuditConfig < 3) { |
| 85 o.auditLogConfigs = buildUnnamed436(); | 85 o.auditLogConfigs = buildUnnamed440(); |
| 86 o.exemptedMembers = buildUnnamed437(); | 86 o.exemptedMembers = buildUnnamed441(); |
| 87 o.service = "foo"; | 87 o.service = "foo"; |
| 88 } | 88 } |
| 89 buildCounterAuditConfig--; | 89 buildCounterAuditConfig--; |
| 90 return o; | 90 return o; |
| 91 } | 91 } |
| 92 | 92 |
| 93 checkAuditConfig(api.AuditConfig o) { | 93 checkAuditConfig(api.AuditConfig o) { |
| 94 buildCounterAuditConfig++; | 94 buildCounterAuditConfig++; |
| 95 if (buildCounterAuditConfig < 3) { | 95 if (buildCounterAuditConfig < 3) { |
| 96 checkUnnamed436(o.auditLogConfigs); | 96 checkUnnamed440(o.auditLogConfigs); |
| 97 checkUnnamed437(o.exemptedMembers); | 97 checkUnnamed441(o.exemptedMembers); |
| 98 unittest.expect(o.service, unittest.equals('foo')); | 98 unittest.expect(o.service, unittest.equals('foo')); |
| 99 } | 99 } |
| 100 buildCounterAuditConfig--; | 100 buildCounterAuditConfig--; |
| 101 } | 101 } |
| 102 | 102 |
| 103 buildUnnamed438() { | 103 buildUnnamed442() { |
| 104 var o = new core.List<core.String>(); | 104 var o = new core.List<core.String>(); |
| 105 o.add("foo"); | 105 o.add("foo"); |
| 106 o.add("foo"); | 106 o.add("foo"); |
| 107 return o; | 107 return o; |
| 108 } | 108 } |
| 109 | 109 |
| 110 checkUnnamed438(core.List<core.String> o) { | 110 checkUnnamed442(core.List<core.String> o) { |
| 111 unittest.expect(o, unittest.hasLength(2)); | 111 unittest.expect(o, unittest.hasLength(2)); |
| 112 unittest.expect(o[0], unittest.equals('foo')); | 112 unittest.expect(o[0], unittest.equals('foo')); |
| 113 unittest.expect(o[1], unittest.equals('foo')); | 113 unittest.expect(o[1], unittest.equals('foo')); |
| 114 } | 114 } |
| 115 | 115 |
| 116 core.int buildCounterAuditLogConfig = 0; | 116 core.int buildCounterAuditLogConfig = 0; |
| 117 buildAuditLogConfig() { | 117 buildAuditLogConfig() { |
| 118 var o = new api.AuditLogConfig(); | 118 var o = new api.AuditLogConfig(); |
| 119 buildCounterAuditLogConfig++; | 119 buildCounterAuditLogConfig++; |
| 120 if (buildCounterAuditLogConfig < 3) { | 120 if (buildCounterAuditLogConfig < 3) { |
| 121 o.exemptedMembers = buildUnnamed438(); | 121 o.exemptedMembers = buildUnnamed442(); |
| 122 o.logType = "foo"; | 122 o.logType = "foo"; |
| 123 } | 123 } |
| 124 buildCounterAuditLogConfig--; | 124 buildCounterAuditLogConfig--; |
| 125 return o; | 125 return o; |
| 126 } | 126 } |
| 127 | 127 |
| 128 checkAuditLogConfig(api.AuditLogConfig o) { | 128 checkAuditLogConfig(api.AuditLogConfig o) { |
| 129 buildCounterAuditLogConfig++; | 129 buildCounterAuditLogConfig++; |
| 130 if (buildCounterAuditLogConfig < 3) { | 130 if (buildCounterAuditLogConfig < 3) { |
| 131 checkUnnamed438(o.exemptedMembers); | 131 checkUnnamed442(o.exemptedMembers); |
| 132 unittest.expect(o.logType, unittest.equals('foo')); | 132 unittest.expect(o.logType, unittest.equals('foo')); |
| 133 } | 133 } |
| 134 buildCounterAuditLogConfig--; | 134 buildCounterAuditLogConfig--; |
| 135 } | 135 } |
| 136 | 136 |
| 137 buildUnnamed439() { | 137 buildUnnamed443() { |
| 138 var o = new core.List<core.String>(); | 138 var o = new core.List<core.String>(); |
| 139 o.add("foo"); | 139 o.add("foo"); |
| 140 o.add("foo"); | 140 o.add("foo"); |
| 141 return o; | 141 return o; |
| 142 } | 142 } |
| 143 | 143 |
| 144 checkUnnamed439(core.List<core.String> o) { | 144 checkUnnamed443(core.List<core.String> o) { |
| 145 unittest.expect(o, unittest.hasLength(2)); | 145 unittest.expect(o, unittest.hasLength(2)); |
| 146 unittest.expect(o[0], unittest.equals('foo')); | 146 unittest.expect(o[0], unittest.equals('foo')); |
| 147 unittest.expect(o[1], unittest.equals('foo')); | 147 unittest.expect(o[1], unittest.equals('foo')); |
| 148 } | 148 } |
| 149 | 149 |
| 150 core.int buildCounterBinding = 0; | 150 core.int buildCounterBinding = 0; |
| 151 buildBinding() { | 151 buildBinding() { |
| 152 var o = new api.Binding(); | 152 var o = new api.Binding(); |
| 153 buildCounterBinding++; | 153 buildCounterBinding++; |
| 154 if (buildCounterBinding < 3) { | 154 if (buildCounterBinding < 3) { |
| 155 o.members = buildUnnamed439(); | 155 o.members = buildUnnamed443(); |
| 156 o.role = "foo"; | 156 o.role = "foo"; |
| 157 } | 157 } |
| 158 buildCounterBinding--; | 158 buildCounterBinding--; |
| 159 return o; | 159 return o; |
| 160 } | 160 } |
| 161 | 161 |
| 162 checkBinding(api.Binding o) { | 162 checkBinding(api.Binding o) { |
| 163 buildCounterBinding++; | 163 buildCounterBinding++; |
| 164 if (buildCounterBinding < 3) { | 164 if (buildCounterBinding < 3) { |
| 165 checkUnnamed439(o.members); | 165 checkUnnamed443(o.members); |
| 166 unittest.expect(o.role, unittest.equals('foo')); | 166 unittest.expect(o.role, unittest.equals('foo')); |
| 167 } | 167 } |
| 168 buildCounterBinding--; | 168 buildCounterBinding--; |
| 169 } | 169 } |
| 170 | 170 |
| 171 core.int buildCounterCloudAuditOptions = 0; | 171 core.int buildCounterCloudAuditOptions = 0; |
| 172 buildCloudAuditOptions() { | 172 buildCloudAuditOptions() { |
| 173 var o = new api.CloudAuditOptions(); | 173 var o = new api.CloudAuditOptions(); |
| 174 buildCounterCloudAuditOptions++; | 174 buildCounterCloudAuditOptions++; |
| 175 if (buildCounterCloudAuditOptions < 3) { | 175 if (buildCounterCloudAuditOptions < 3) { |
| 176 o.logName = "foo"; |
| 176 } | 177 } |
| 177 buildCounterCloudAuditOptions--; | 178 buildCounterCloudAuditOptions--; |
| 178 return o; | 179 return o; |
| 179 } | 180 } |
| 180 | 181 |
| 181 checkCloudAuditOptions(api.CloudAuditOptions o) { | 182 checkCloudAuditOptions(api.CloudAuditOptions o) { |
| 182 buildCounterCloudAuditOptions++; | 183 buildCounterCloudAuditOptions++; |
| 183 if (buildCounterCloudAuditOptions < 3) { | 184 if (buildCounterCloudAuditOptions < 3) { |
| 185 unittest.expect(o.logName, unittest.equals('foo')); |
| 184 } | 186 } |
| 185 buildCounterCloudAuditOptions--; | 187 buildCounterCloudAuditOptions--; |
| 186 } | 188 } |
| 187 | 189 |
| 188 buildUnnamed440() { | 190 buildUnnamed444() { |
| 189 var o = new core.List<core.String>(); | 191 var o = new core.List<core.String>(); |
| 190 o.add("foo"); | 192 o.add("foo"); |
| 191 o.add("foo"); | 193 o.add("foo"); |
| 192 return o; | 194 return o; |
| 193 } | 195 } |
| 194 | 196 |
| 195 checkUnnamed440(core.List<core.String> o) { | 197 checkUnnamed444(core.List<core.String> o) { |
| 196 unittest.expect(o, unittest.hasLength(2)); | 198 unittest.expect(o, unittest.hasLength(2)); |
| 197 unittest.expect(o[0], unittest.equals('foo')); | 199 unittest.expect(o[0], unittest.equals('foo')); |
| 198 unittest.expect(o[1], unittest.equals('foo')); | 200 unittest.expect(o[1], unittest.equals('foo')); |
| 199 } | 201 } |
| 200 | 202 |
| 201 core.int buildCounterCondition = 0; | 203 core.int buildCounterCondition = 0; |
| 202 buildCondition() { | 204 buildCondition() { |
| 203 var o = new api.Condition(); | 205 var o = new api.Condition(); |
| 204 buildCounterCondition++; | 206 buildCounterCondition++; |
| 205 if (buildCounterCondition < 3) { | 207 if (buildCounterCondition < 3) { |
| 206 o.iam = "foo"; | 208 o.iam = "foo"; |
| 207 o.op = "foo"; | 209 o.op = "foo"; |
| 208 o.svc = "foo"; | 210 o.svc = "foo"; |
| 209 o.sys = "foo"; | 211 o.sys = "foo"; |
| 210 o.value = "foo"; | 212 o.value = "foo"; |
| 211 o.values = buildUnnamed440(); | 213 o.values = buildUnnamed444(); |
| 212 } | 214 } |
| 213 buildCounterCondition--; | 215 buildCounterCondition--; |
| 214 return o; | 216 return o; |
| 215 } | 217 } |
| 216 | 218 |
| 217 checkCondition(api.Condition o) { | 219 checkCondition(api.Condition o) { |
| 218 buildCounterCondition++; | 220 buildCounterCondition++; |
| 219 if (buildCounterCondition < 3) { | 221 if (buildCounterCondition < 3) { |
| 220 unittest.expect(o.iam, unittest.equals('foo')); | 222 unittest.expect(o.iam, unittest.equals('foo')); |
| 221 unittest.expect(o.op, unittest.equals('foo')); | 223 unittest.expect(o.op, unittest.equals('foo')); |
| 222 unittest.expect(o.svc, unittest.equals('foo')); | 224 unittest.expect(o.svc, unittest.equals('foo')); |
| 223 unittest.expect(o.sys, unittest.equals('foo')); | 225 unittest.expect(o.sys, unittest.equals('foo')); |
| 224 unittest.expect(o.value, unittest.equals('foo')); | 226 unittest.expect(o.value, unittest.equals('foo')); |
| 225 checkUnnamed440(o.values); | 227 checkUnnamed444(o.values); |
| 226 } | 228 } |
| 227 buildCounterCondition--; | 229 buildCounterCondition--; |
| 228 } | 230 } |
| 229 | 231 |
| 230 core.int buildCounterCounterOptions = 0; | 232 core.int buildCounterCounterOptions = 0; |
| 231 buildCounterOptions() { | 233 buildCounterOptions() { |
| 232 var o = new api.CounterOptions(); | 234 var o = new api.CounterOptions(); |
| 233 buildCounterCounterOptions++; | 235 buildCounterCounterOptions++; |
| 234 if (buildCounterCounterOptions < 3) { | 236 if (buildCounterCounterOptions < 3) { |
| 235 o.field = "foo"; | 237 o.field = "foo"; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 return o; | 277 return o; |
| 276 } | 278 } |
| 277 | 279 |
| 278 checkEmpty(api.Empty o) { | 280 checkEmpty(api.Empty o) { |
| 279 buildCounterEmpty++; | 281 buildCounterEmpty++; |
| 280 if (buildCounterEmpty < 3) { | 282 if (buildCounterEmpty < 3) { |
| 281 } | 283 } |
| 282 buildCounterEmpty--; | 284 buildCounterEmpty--; |
| 283 } | 285 } |
| 284 | 286 |
| 285 buildUnnamed441() { | 287 buildUnnamed445() { |
| 286 var o = new core.List<api.Repo>(); | 288 var o = new core.List<api.Repo>(); |
| 287 o.add(buildRepo()); | 289 o.add(buildRepo()); |
| 288 o.add(buildRepo()); | 290 o.add(buildRepo()); |
| 289 return o; | 291 return o; |
| 290 } | 292 } |
| 291 | 293 |
| 292 checkUnnamed441(core.List<api.Repo> o) { | 294 checkUnnamed445(core.List<api.Repo> o) { |
| 293 unittest.expect(o, unittest.hasLength(2)); | 295 unittest.expect(o, unittest.hasLength(2)); |
| 294 checkRepo(o[0]); | 296 checkRepo(o[0]); |
| 295 checkRepo(o[1]); | 297 checkRepo(o[1]); |
| 296 } | 298 } |
| 297 | 299 |
| 298 core.int buildCounterListReposResponse = 0; | 300 core.int buildCounterListReposResponse = 0; |
| 299 buildListReposResponse() { | 301 buildListReposResponse() { |
| 300 var o = new api.ListReposResponse(); | 302 var o = new api.ListReposResponse(); |
| 301 buildCounterListReposResponse++; | 303 buildCounterListReposResponse++; |
| 302 if (buildCounterListReposResponse < 3) { | 304 if (buildCounterListReposResponse < 3) { |
| 303 o.nextPageToken = "foo"; | 305 o.nextPageToken = "foo"; |
| 304 o.repos = buildUnnamed441(); | 306 o.repos = buildUnnamed445(); |
| 305 } | 307 } |
| 306 buildCounterListReposResponse--; | 308 buildCounterListReposResponse--; |
| 307 return o; | 309 return o; |
| 308 } | 310 } |
| 309 | 311 |
| 310 checkListReposResponse(api.ListReposResponse o) { | 312 checkListReposResponse(api.ListReposResponse o) { |
| 311 buildCounterListReposResponse++; | 313 buildCounterListReposResponse++; |
| 312 if (buildCounterListReposResponse < 3) { | 314 if (buildCounterListReposResponse < 3) { |
| 313 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 315 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 314 checkUnnamed441(o.repos); | 316 checkUnnamed445(o.repos); |
| 315 } | 317 } |
| 316 buildCounterListReposResponse--; | 318 buildCounterListReposResponse--; |
| 317 } | 319 } |
| 318 | 320 |
| 319 core.int buildCounterLogConfig = 0; | 321 core.int buildCounterLogConfig = 0; |
| 320 buildLogConfig() { | 322 buildLogConfig() { |
| 321 var o = new api.LogConfig(); | 323 var o = new api.LogConfig(); |
| 322 buildCounterLogConfig++; | 324 buildCounterLogConfig++; |
| 323 if (buildCounterLogConfig < 3) { | 325 if (buildCounterLogConfig < 3) { |
| 324 o.cloudAudit = buildCloudAuditOptions(); | 326 o.cloudAudit = buildCloudAuditOptions(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 355 checkMirrorConfig(api.MirrorConfig o) { | 357 checkMirrorConfig(api.MirrorConfig o) { |
| 356 buildCounterMirrorConfig++; | 358 buildCounterMirrorConfig++; |
| 357 if (buildCounterMirrorConfig < 3) { | 359 if (buildCounterMirrorConfig < 3) { |
| 358 unittest.expect(o.deployKeyId, unittest.equals('foo')); | 360 unittest.expect(o.deployKeyId, unittest.equals('foo')); |
| 359 unittest.expect(o.url, unittest.equals('foo')); | 361 unittest.expect(o.url, unittest.equals('foo')); |
| 360 unittest.expect(o.webhookId, unittest.equals('foo')); | 362 unittest.expect(o.webhookId, unittest.equals('foo')); |
| 361 } | 363 } |
| 362 buildCounterMirrorConfig--; | 364 buildCounterMirrorConfig--; |
| 363 } | 365 } |
| 364 | 366 |
| 365 buildUnnamed442() { | 367 buildUnnamed446() { |
| 366 var o = new core.List<api.AuditConfig>(); | 368 var o = new core.List<api.AuditConfig>(); |
| 367 o.add(buildAuditConfig()); | 369 o.add(buildAuditConfig()); |
| 368 o.add(buildAuditConfig()); | 370 o.add(buildAuditConfig()); |
| 369 return o; | 371 return o; |
| 370 } | 372 } |
| 371 | 373 |
| 372 checkUnnamed442(core.List<api.AuditConfig> o) { | 374 checkUnnamed446(core.List<api.AuditConfig> o) { |
| 373 unittest.expect(o, unittest.hasLength(2)); | 375 unittest.expect(o, unittest.hasLength(2)); |
| 374 checkAuditConfig(o[0]); | 376 checkAuditConfig(o[0]); |
| 375 checkAuditConfig(o[1]); | 377 checkAuditConfig(o[1]); |
| 376 } | 378 } |
| 377 | 379 |
| 378 buildUnnamed443() { | 380 buildUnnamed447() { |
| 379 var o = new core.List<api.Binding>(); | 381 var o = new core.List<api.Binding>(); |
| 380 o.add(buildBinding()); | 382 o.add(buildBinding()); |
| 381 o.add(buildBinding()); | 383 o.add(buildBinding()); |
| 382 return o; | 384 return o; |
| 383 } | 385 } |
| 384 | 386 |
| 385 checkUnnamed443(core.List<api.Binding> o) { | 387 checkUnnamed447(core.List<api.Binding> o) { |
| 386 unittest.expect(o, unittest.hasLength(2)); | 388 unittest.expect(o, unittest.hasLength(2)); |
| 387 checkBinding(o[0]); | 389 checkBinding(o[0]); |
| 388 checkBinding(o[1]); | 390 checkBinding(o[1]); |
| 389 } | 391 } |
| 390 | 392 |
| 391 buildUnnamed444() { | 393 buildUnnamed448() { |
| 392 var o = new core.List<api.Rule>(); | 394 var o = new core.List<api.Rule>(); |
| 393 o.add(buildRule()); | 395 o.add(buildRule()); |
| 394 o.add(buildRule()); | 396 o.add(buildRule()); |
| 395 return o; | 397 return o; |
| 396 } | 398 } |
| 397 | 399 |
| 398 checkUnnamed444(core.List<api.Rule> o) { | 400 checkUnnamed448(core.List<api.Rule> o) { |
| 399 unittest.expect(o, unittest.hasLength(2)); | 401 unittest.expect(o, unittest.hasLength(2)); |
| 400 checkRule(o[0]); | 402 checkRule(o[0]); |
| 401 checkRule(o[1]); | 403 checkRule(o[1]); |
| 402 } | 404 } |
| 403 | 405 |
| 404 core.int buildCounterPolicy = 0; | 406 core.int buildCounterPolicy = 0; |
| 405 buildPolicy() { | 407 buildPolicy() { |
| 406 var o = new api.Policy(); | 408 var o = new api.Policy(); |
| 407 buildCounterPolicy++; | 409 buildCounterPolicy++; |
| 408 if (buildCounterPolicy < 3) { | 410 if (buildCounterPolicy < 3) { |
| 409 o.auditConfigs = buildUnnamed442(); | 411 o.auditConfigs = buildUnnamed446(); |
| 410 o.bindings = buildUnnamed443(); | 412 o.bindings = buildUnnamed447(); |
| 411 o.etag = "foo"; | 413 o.etag = "foo"; |
| 412 o.iamOwned = true; | 414 o.iamOwned = true; |
| 413 o.rules = buildUnnamed444(); | 415 o.rules = buildUnnamed448(); |
| 414 o.version = 42; | 416 o.version = 42; |
| 415 } | 417 } |
| 416 buildCounterPolicy--; | 418 buildCounterPolicy--; |
| 417 return o; | 419 return o; |
| 418 } | 420 } |
| 419 | 421 |
| 420 checkPolicy(api.Policy o) { | 422 checkPolicy(api.Policy o) { |
| 421 buildCounterPolicy++; | 423 buildCounterPolicy++; |
| 422 if (buildCounterPolicy < 3) { | 424 if (buildCounterPolicy < 3) { |
| 423 checkUnnamed442(o.auditConfigs); | 425 checkUnnamed446(o.auditConfigs); |
| 424 checkUnnamed443(o.bindings); | 426 checkUnnamed447(o.bindings); |
| 425 unittest.expect(o.etag, unittest.equals('foo')); | 427 unittest.expect(o.etag, unittest.equals('foo')); |
| 426 unittest.expect(o.iamOwned, unittest.isTrue); | 428 unittest.expect(o.iamOwned, unittest.isTrue); |
| 427 checkUnnamed444(o.rules); | 429 checkUnnamed448(o.rules); |
| 428 unittest.expect(o.version, unittest.equals(42)); | 430 unittest.expect(o.version, unittest.equals(42)); |
| 429 } | 431 } |
| 430 buildCounterPolicy--; | 432 buildCounterPolicy--; |
| 431 } | 433 } |
| 432 | 434 |
| 433 core.int buildCounterRepo = 0; | 435 core.int buildCounterRepo = 0; |
| 434 buildRepo() { | 436 buildRepo() { |
| 435 var o = new api.Repo(); | 437 var o = new api.Repo(); |
| 436 buildCounterRepo++; | 438 buildCounterRepo++; |
| 437 if (buildCounterRepo < 3) { | 439 if (buildCounterRepo < 3) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 448 buildCounterRepo++; | 450 buildCounterRepo++; |
| 449 if (buildCounterRepo < 3) { | 451 if (buildCounterRepo < 3) { |
| 450 checkMirrorConfig(o.mirrorConfig); | 452 checkMirrorConfig(o.mirrorConfig); |
| 451 unittest.expect(o.name, unittest.equals('foo')); | 453 unittest.expect(o.name, unittest.equals('foo')); |
| 452 unittest.expect(o.size, unittest.equals('foo')); | 454 unittest.expect(o.size, unittest.equals('foo')); |
| 453 unittest.expect(o.url, unittest.equals('foo')); | 455 unittest.expect(o.url, unittest.equals('foo')); |
| 454 } | 456 } |
| 455 buildCounterRepo--; | 457 buildCounterRepo--; |
| 456 } | 458 } |
| 457 | 459 |
| 458 buildUnnamed445() { | 460 buildUnnamed449() { |
| 459 var o = new core.List<api.Condition>(); | 461 var o = new core.List<api.Condition>(); |
| 460 o.add(buildCondition()); | 462 o.add(buildCondition()); |
| 461 o.add(buildCondition()); | 463 o.add(buildCondition()); |
| 462 return o; | 464 return o; |
| 463 } | 465 } |
| 464 | 466 |
| 465 checkUnnamed445(core.List<api.Condition> o) { | 467 checkUnnamed449(core.List<api.Condition> o) { |
| 466 unittest.expect(o, unittest.hasLength(2)); | 468 unittest.expect(o, unittest.hasLength(2)); |
| 467 checkCondition(o[0]); | 469 checkCondition(o[0]); |
| 468 checkCondition(o[1]); | 470 checkCondition(o[1]); |
| 469 } | 471 } |
| 470 | 472 |
| 471 buildUnnamed446() { | 473 buildUnnamed450() { |
| 472 var o = new core.List<core.String>(); | 474 var o = new core.List<core.String>(); |
| 473 o.add("foo"); | 475 o.add("foo"); |
| 474 o.add("foo"); | 476 o.add("foo"); |
| 475 return o; | 477 return o; |
| 476 } | 478 } |
| 477 | 479 |
| 478 checkUnnamed446(core.List<core.String> o) { | 480 checkUnnamed450(core.List<core.String> o) { |
| 479 unittest.expect(o, unittest.hasLength(2)); | 481 unittest.expect(o, unittest.hasLength(2)); |
| 480 unittest.expect(o[0], unittest.equals('foo')); | 482 unittest.expect(o[0], unittest.equals('foo')); |
| 481 unittest.expect(o[1], unittest.equals('foo')); | 483 unittest.expect(o[1], unittest.equals('foo')); |
| 482 } | 484 } |
| 483 | 485 |
| 484 buildUnnamed447() { | 486 buildUnnamed451() { |
| 485 var o = new core.List<api.LogConfig>(); | 487 var o = new core.List<api.LogConfig>(); |
| 486 o.add(buildLogConfig()); | 488 o.add(buildLogConfig()); |
| 487 o.add(buildLogConfig()); | 489 o.add(buildLogConfig()); |
| 488 return o; | 490 return o; |
| 489 } | 491 } |
| 490 | 492 |
| 491 checkUnnamed447(core.List<api.LogConfig> o) { | 493 checkUnnamed451(core.List<api.LogConfig> o) { |
| 492 unittest.expect(o, unittest.hasLength(2)); | 494 unittest.expect(o, unittest.hasLength(2)); |
| 493 checkLogConfig(o[0]); | 495 checkLogConfig(o[0]); |
| 494 checkLogConfig(o[1]); | 496 checkLogConfig(o[1]); |
| 495 } | 497 } |
| 496 | 498 |
| 497 buildUnnamed448() { | 499 buildUnnamed452() { |
| 498 var o = new core.List<core.String>(); | 500 var o = new core.List<core.String>(); |
| 499 o.add("foo"); | 501 o.add("foo"); |
| 500 o.add("foo"); | 502 o.add("foo"); |
| 501 return o; | 503 return o; |
| 502 } | 504 } |
| 503 | 505 |
| 504 checkUnnamed448(core.List<core.String> o) { | 506 checkUnnamed452(core.List<core.String> o) { |
| 505 unittest.expect(o, unittest.hasLength(2)); | 507 unittest.expect(o, unittest.hasLength(2)); |
| 506 unittest.expect(o[0], unittest.equals('foo')); | 508 unittest.expect(o[0], unittest.equals('foo')); |
| 507 unittest.expect(o[1], unittest.equals('foo')); | 509 unittest.expect(o[1], unittest.equals('foo')); |
| 508 } | 510 } |
| 509 | 511 |
| 510 buildUnnamed449() { | 512 buildUnnamed453() { |
| 511 var o = new core.List<core.String>(); | 513 var o = new core.List<core.String>(); |
| 512 o.add("foo"); | 514 o.add("foo"); |
| 513 o.add("foo"); | 515 o.add("foo"); |
| 514 return o; | 516 return o; |
| 515 } | 517 } |
| 516 | 518 |
| 517 checkUnnamed449(core.List<core.String> o) { | 519 checkUnnamed453(core.List<core.String> o) { |
| 518 unittest.expect(o, unittest.hasLength(2)); | 520 unittest.expect(o, unittest.hasLength(2)); |
| 519 unittest.expect(o[0], unittest.equals('foo')); | 521 unittest.expect(o[0], unittest.equals('foo')); |
| 520 unittest.expect(o[1], unittest.equals('foo')); | 522 unittest.expect(o[1], unittest.equals('foo')); |
| 521 } | 523 } |
| 522 | 524 |
| 523 core.int buildCounterRule = 0; | 525 core.int buildCounterRule = 0; |
| 524 buildRule() { | 526 buildRule() { |
| 525 var o = new api.Rule(); | 527 var o = new api.Rule(); |
| 526 buildCounterRule++; | 528 buildCounterRule++; |
| 527 if (buildCounterRule < 3) { | 529 if (buildCounterRule < 3) { |
| 528 o.action = "foo"; | 530 o.action = "foo"; |
| 529 o.conditions = buildUnnamed445(); | 531 o.conditions = buildUnnamed449(); |
| 530 o.description = "foo"; | 532 o.description = "foo"; |
| 531 o.in_ = buildUnnamed446(); | 533 o.in_ = buildUnnamed450(); |
| 532 o.logConfig = buildUnnamed447(); | 534 o.logConfig = buildUnnamed451(); |
| 533 o.notIn = buildUnnamed448(); | 535 o.notIn = buildUnnamed452(); |
| 534 o.permissions = buildUnnamed449(); | 536 o.permissions = buildUnnamed453(); |
| 535 } | 537 } |
| 536 buildCounterRule--; | 538 buildCounterRule--; |
| 537 return o; | 539 return o; |
| 538 } | 540 } |
| 539 | 541 |
| 540 checkRule(api.Rule o) { | 542 checkRule(api.Rule o) { |
| 541 buildCounterRule++; | 543 buildCounterRule++; |
| 542 if (buildCounterRule < 3) { | 544 if (buildCounterRule < 3) { |
| 543 unittest.expect(o.action, unittest.equals('foo')); | 545 unittest.expect(o.action, unittest.equals('foo')); |
| 544 checkUnnamed445(o.conditions); | 546 checkUnnamed449(o.conditions); |
| 545 unittest.expect(o.description, unittest.equals('foo')); | 547 unittest.expect(o.description, unittest.equals('foo')); |
| 546 checkUnnamed446(o.in_); | 548 checkUnnamed450(o.in_); |
| 547 checkUnnamed447(o.logConfig); | 549 checkUnnamed451(o.logConfig); |
| 548 checkUnnamed448(o.notIn); | 550 checkUnnamed452(o.notIn); |
| 549 checkUnnamed449(o.permissions); | 551 checkUnnamed453(o.permissions); |
| 550 } | 552 } |
| 551 buildCounterRule--; | 553 buildCounterRule--; |
| 552 } | 554 } |
| 553 | 555 |
| 554 core.int buildCounterSetIamPolicyRequest = 0; | 556 core.int buildCounterSetIamPolicyRequest = 0; |
| 555 buildSetIamPolicyRequest() { | 557 buildSetIamPolicyRequest() { |
| 556 var o = new api.SetIamPolicyRequest(); | 558 var o = new api.SetIamPolicyRequest(); |
| 557 buildCounterSetIamPolicyRequest++; | 559 buildCounterSetIamPolicyRequest++; |
| 558 if (buildCounterSetIamPolicyRequest < 3) { | 560 if (buildCounterSetIamPolicyRequest < 3) { |
| 559 o.policy = buildPolicy(); | 561 o.policy = buildPolicy(); |
| 560 o.updateMask = "foo"; | 562 o.updateMask = "foo"; |
| 561 } | 563 } |
| 562 buildCounterSetIamPolicyRequest--; | 564 buildCounterSetIamPolicyRequest--; |
| 563 return o; | 565 return o; |
| 564 } | 566 } |
| 565 | 567 |
| 566 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { | 568 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
| 567 buildCounterSetIamPolicyRequest++; | 569 buildCounterSetIamPolicyRequest++; |
| 568 if (buildCounterSetIamPolicyRequest < 3) { | 570 if (buildCounterSetIamPolicyRequest < 3) { |
| 569 checkPolicy(o.policy); | 571 checkPolicy(o.policy); |
| 570 unittest.expect(o.updateMask, unittest.equals('foo')); | 572 unittest.expect(o.updateMask, unittest.equals('foo')); |
| 571 } | 573 } |
| 572 buildCounterSetIamPolicyRequest--; | 574 buildCounterSetIamPolicyRequest--; |
| 573 } | 575 } |
| 574 | 576 |
| 575 buildUnnamed450() { | 577 buildUnnamed454() { |
| 576 var o = new core.List<core.String>(); | 578 var o = new core.List<core.String>(); |
| 577 o.add("foo"); | 579 o.add("foo"); |
| 578 o.add("foo"); | 580 o.add("foo"); |
| 579 return o; | 581 return o; |
| 580 } | 582 } |
| 581 | 583 |
| 582 checkUnnamed450(core.List<core.String> o) { | 584 checkUnnamed454(core.List<core.String> o) { |
| 583 unittest.expect(o, unittest.hasLength(2)); | 585 unittest.expect(o, unittest.hasLength(2)); |
| 584 unittest.expect(o[0], unittest.equals('foo')); | 586 unittest.expect(o[0], unittest.equals('foo')); |
| 585 unittest.expect(o[1], unittest.equals('foo')); | 587 unittest.expect(o[1], unittest.equals('foo')); |
| 586 } | 588 } |
| 587 | 589 |
| 588 core.int buildCounterTestIamPermissionsRequest = 0; | 590 core.int buildCounterTestIamPermissionsRequest = 0; |
| 589 buildTestIamPermissionsRequest() { | 591 buildTestIamPermissionsRequest() { |
| 590 var o = new api.TestIamPermissionsRequest(); | 592 var o = new api.TestIamPermissionsRequest(); |
| 591 buildCounterTestIamPermissionsRequest++; | 593 buildCounterTestIamPermissionsRequest++; |
| 592 if (buildCounterTestIamPermissionsRequest < 3) { | 594 if (buildCounterTestIamPermissionsRequest < 3) { |
| 593 o.permissions = buildUnnamed450(); | 595 o.permissions = buildUnnamed454(); |
| 594 } | 596 } |
| 595 buildCounterTestIamPermissionsRequest--; | 597 buildCounterTestIamPermissionsRequest--; |
| 596 return o; | 598 return o; |
| 597 } | 599 } |
| 598 | 600 |
| 599 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { | 601 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| 600 buildCounterTestIamPermissionsRequest++; | 602 buildCounterTestIamPermissionsRequest++; |
| 601 if (buildCounterTestIamPermissionsRequest < 3) { | 603 if (buildCounterTestIamPermissionsRequest < 3) { |
| 602 checkUnnamed450(o.permissions); | 604 checkUnnamed454(o.permissions); |
| 603 } | 605 } |
| 604 buildCounterTestIamPermissionsRequest--; | 606 buildCounterTestIamPermissionsRequest--; |
| 605 } | 607 } |
| 606 | 608 |
| 607 buildUnnamed451() { | 609 buildUnnamed455() { |
| 608 var o = new core.List<core.String>(); | 610 var o = new core.List<core.String>(); |
| 609 o.add("foo"); | 611 o.add("foo"); |
| 610 o.add("foo"); | 612 o.add("foo"); |
| 611 return o; | 613 return o; |
| 612 } | 614 } |
| 613 | 615 |
| 614 checkUnnamed451(core.List<core.String> o) { | 616 checkUnnamed455(core.List<core.String> o) { |
| 615 unittest.expect(o, unittest.hasLength(2)); | 617 unittest.expect(o, unittest.hasLength(2)); |
| 616 unittest.expect(o[0], unittest.equals('foo')); | 618 unittest.expect(o[0], unittest.equals('foo')); |
| 617 unittest.expect(o[1], unittest.equals('foo')); | 619 unittest.expect(o[1], unittest.equals('foo')); |
| 618 } | 620 } |
| 619 | 621 |
| 620 core.int buildCounterTestIamPermissionsResponse = 0; | 622 core.int buildCounterTestIamPermissionsResponse = 0; |
| 621 buildTestIamPermissionsResponse() { | 623 buildTestIamPermissionsResponse() { |
| 622 var o = new api.TestIamPermissionsResponse(); | 624 var o = new api.TestIamPermissionsResponse(); |
| 623 buildCounterTestIamPermissionsResponse++; | 625 buildCounterTestIamPermissionsResponse++; |
| 624 if (buildCounterTestIamPermissionsResponse < 3) { | 626 if (buildCounterTestIamPermissionsResponse < 3) { |
| 625 o.permissions = buildUnnamed451(); | 627 o.permissions = buildUnnamed455(); |
| 626 } | 628 } |
| 627 buildCounterTestIamPermissionsResponse--; | 629 buildCounterTestIamPermissionsResponse--; |
| 628 return o; | 630 return o; |
| 629 } | 631 } |
| 630 | 632 |
| 631 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { | 633 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| 632 buildCounterTestIamPermissionsResponse++; | 634 buildCounterTestIamPermissionsResponse++; |
| 633 if (buildCounterTestIamPermissionsResponse < 3) { | 635 if (buildCounterTestIamPermissionsResponse < 3) { |
| 634 checkUnnamed451(o.permissions); | 636 checkUnnamed455(o.permissions); |
| 635 } | 637 } |
| 636 buildCounterTestIamPermissionsResponse--; | 638 buildCounterTestIamPermissionsResponse--; |
| 637 } | 639 } |
| 638 | 640 |
| 639 | 641 |
| 640 main() { | 642 main() { |
| 641 unittest.group("obj-schema-AuditConfig", () { | 643 unittest.group("obj-schema-AuditConfig", () { |
| 642 unittest.test("to-json--from-json", () { | 644 unittest.test("to-json--from-json", () { |
| 643 var o = buildAuditConfig(); | 645 var o = buildAuditConfig(); |
| 644 var od = new api.AuditConfig.fromJson(o.toJson()); | 646 var od = new api.AuditConfig.fromJson(o.toJson()); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 }); | 793 }); |
| 792 | 794 |
| 793 | 795 |
| 794 unittest.group("resource-ProjectsReposResourceApi", () { | 796 unittest.group("resource-ProjectsReposResourceApi", () { |
| 795 unittest.test("method--create", () { | 797 unittest.test("method--create", () { |
| 796 | 798 |
| 797 var mock = new HttpServerMock(); | 799 var mock = new HttpServerMock(); |
| 798 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; | 800 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; |
| 799 var arg_request = buildRepo(); | 801 var arg_request = buildRepo(); |
| 800 var arg_parent = "foo"; | 802 var arg_parent = "foo"; |
| 801 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 803 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 802 var obj = new api.Repo.fromJson(json); | 804 var obj = new api.Repo.fromJson(json); |
| 803 checkRepo(obj); | 805 checkRepo(obj); |
| 804 | 806 |
| 805 var path = (req.url).path; | 807 var path = (req.url).path; |
| 806 var pathOffset = 0; | 808 var pathOffset = 0; |
| 807 var index; | 809 var index; |
| 808 var subPart; | 810 var subPart; |
| 809 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 811 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 810 pathOffset += 1; | 812 pathOffset += 1; |
| 811 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 813 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 829 } | 831 } |
| 830 } | 832 } |
| 831 | 833 |
| 832 | 834 |
| 833 var h = { | 835 var h = { |
| 834 "content-type" : "application/json; charset=utf-8", | 836 "content-type" : "application/json; charset=utf-8", |
| 835 }; | 837 }; |
| 836 var resp = convert.JSON.encode(buildRepo()); | 838 var resp = convert.JSON.encode(buildRepo()); |
| 837 return new async.Future.value(stringResponse(200, h, resp)); | 839 return new async.Future.value(stringResponse(200, h, resp)); |
| 838 }), true); | 840 }), true); |
| 839 res.create(arg_request, arg_parent).then(unittest.expectAsync(((api.Repo r
esponse) { | 841 res.create(arg_request, arg_parent).then(unittest.expectAsync1(((api.Repo
response) { |
| 840 checkRepo(response); | 842 checkRepo(response); |
| 841 }))); | 843 }))); |
| 842 }); | 844 }); |
| 843 | 845 |
| 844 unittest.test("method--delete", () { | 846 unittest.test("method--delete", () { |
| 845 | 847 |
| 846 var mock = new HttpServerMock(); | 848 var mock = new HttpServerMock(); |
| 847 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; | 849 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; |
| 848 var arg_name = "foo"; | 850 var arg_name = "foo"; |
| 849 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 851 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 850 var path = (req.url).path; | 852 var path = (req.url).path; |
| 851 var pathOffset = 0; | 853 var pathOffset = 0; |
| 852 var index; | 854 var index; |
| 853 var subPart; | 855 var subPart; |
| 854 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 856 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 855 pathOffset += 1; | 857 pathOffset += 1; |
| 856 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 858 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 857 pathOffset += 3; | 859 pathOffset += 3; |
| 858 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 860 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 859 | 861 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 874 } | 876 } |
| 875 } | 877 } |
| 876 | 878 |
| 877 | 879 |
| 878 var h = { | 880 var h = { |
| 879 "content-type" : "application/json; charset=utf-8", | 881 "content-type" : "application/json; charset=utf-8", |
| 880 }; | 882 }; |
| 881 var resp = convert.JSON.encode(buildEmpty()); | 883 var resp = convert.JSON.encode(buildEmpty()); |
| 882 return new async.Future.value(stringResponse(200, h, resp)); | 884 return new async.Future.value(stringResponse(200, h, resp)); |
| 883 }), true); | 885 }), true); |
| 884 res.delete(arg_name).then(unittest.expectAsync(((api.Empty response) { | 886 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { |
| 885 checkEmpty(response); | 887 checkEmpty(response); |
| 886 }))); | 888 }))); |
| 887 }); | 889 }); |
| 888 | 890 |
| 889 unittest.test("method--get", () { | 891 unittest.test("method--get", () { |
| 890 | 892 |
| 891 var mock = new HttpServerMock(); | 893 var mock = new HttpServerMock(); |
| 892 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; | 894 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; |
| 893 var arg_name = "foo"; | 895 var arg_name = "foo"; |
| 894 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 896 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 895 var path = (req.url).path; | 897 var path = (req.url).path; |
| 896 var pathOffset = 0; | 898 var pathOffset = 0; |
| 897 var index; | 899 var index; |
| 898 var subPart; | 900 var subPart; |
| 899 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 901 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 900 pathOffset += 1; | 902 pathOffset += 1; |
| 901 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 903 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 902 pathOffset += 3; | 904 pathOffset += 3; |
| 903 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 905 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 904 | 906 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 919 } | 921 } |
| 920 } | 922 } |
| 921 | 923 |
| 922 | 924 |
| 923 var h = { | 925 var h = { |
| 924 "content-type" : "application/json; charset=utf-8", | 926 "content-type" : "application/json; charset=utf-8", |
| 925 }; | 927 }; |
| 926 var resp = convert.JSON.encode(buildRepo()); | 928 var resp = convert.JSON.encode(buildRepo()); |
| 927 return new async.Future.value(stringResponse(200, h, resp)); | 929 return new async.Future.value(stringResponse(200, h, resp)); |
| 928 }), true); | 930 }), true); |
| 929 res.get(arg_name).then(unittest.expectAsync(((api.Repo response) { | 931 res.get(arg_name).then(unittest.expectAsync1(((api.Repo response) { |
| 930 checkRepo(response); | 932 checkRepo(response); |
| 931 }))); | 933 }))); |
| 932 }); | 934 }); |
| 933 | 935 |
| 934 unittest.test("method--getIamPolicy", () { | 936 unittest.test("method--getIamPolicy", () { |
| 935 | 937 |
| 936 var mock = new HttpServerMock(); | 938 var mock = new HttpServerMock(); |
| 937 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; | 939 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; |
| 938 var arg_resource = "foo"; | 940 var arg_resource = "foo"; |
| 939 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 941 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 940 var path = (req.url).path; | 942 var path = (req.url).path; |
| 941 var pathOffset = 0; | 943 var pathOffset = 0; |
| 942 var index; | 944 var index; |
| 943 var subPart; | 945 var subPart; |
| 944 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 946 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 945 pathOffset += 1; | 947 pathOffset += 1; |
| 946 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 948 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 947 pathOffset += 3; | 949 pathOffset += 3; |
| 948 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 950 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 949 | 951 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 964 } | 966 } |
| 965 } | 967 } |
| 966 | 968 |
| 967 | 969 |
| 968 var h = { | 970 var h = { |
| 969 "content-type" : "application/json; charset=utf-8", | 971 "content-type" : "application/json; charset=utf-8", |
| 970 }; | 972 }; |
| 971 var resp = convert.JSON.encode(buildPolicy()); | 973 var resp = convert.JSON.encode(buildPolicy()); |
| 972 return new async.Future.value(stringResponse(200, h, resp)); | 974 return new async.Future.value(stringResponse(200, h, resp)); |
| 973 }), true); | 975 }), true); |
| 974 res.getIamPolicy(arg_resource).then(unittest.expectAsync(((api.Policy resp
onse) { | 976 res.getIamPolicy(arg_resource).then(unittest.expectAsync1(((api.Policy res
ponse) { |
| 975 checkPolicy(response); | 977 checkPolicy(response); |
| 976 }))); | 978 }))); |
| 977 }); | 979 }); |
| 978 | 980 |
| 979 unittest.test("method--list", () { | 981 unittest.test("method--list", () { |
| 980 | 982 |
| 981 var mock = new HttpServerMock(); | 983 var mock = new HttpServerMock(); |
| 982 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; | 984 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; |
| 983 var arg_name = "foo"; | 985 var arg_name = "foo"; |
| 984 var arg_pageToken = "foo"; | 986 var arg_pageToken = "foo"; |
| 985 var arg_pageSize = 42; | 987 var arg_pageSize = 42; |
| 986 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 988 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 987 var path = (req.url).path; | 989 var path = (req.url).path; |
| 988 var pathOffset = 0; | 990 var pathOffset = 0; |
| 989 var index; | 991 var index; |
| 990 var subPart; | 992 var subPart; |
| 991 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 993 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 992 pathOffset += 1; | 994 pathOffset += 1; |
| 993 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 995 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 994 pathOffset += 3; | 996 pathOffset += 3; |
| 995 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 997 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 996 | 998 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1013 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1015 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1014 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1016 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1015 | 1017 |
| 1016 | 1018 |
| 1017 var h = { | 1019 var h = { |
| 1018 "content-type" : "application/json; charset=utf-8", | 1020 "content-type" : "application/json; charset=utf-8", |
| 1019 }; | 1021 }; |
| 1020 var resp = convert.JSON.encode(buildListReposResponse()); | 1022 var resp = convert.JSON.encode(buildListReposResponse()); |
| 1021 return new async.Future.value(stringResponse(200, h, resp)); | 1023 return new async.Future.value(stringResponse(200, h, resp)); |
| 1022 }), true); | 1024 }), true); |
| 1023 res.list(arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize).then(
unittest.expectAsync(((api.ListReposResponse response) { | 1025 res.list(arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize).then(
unittest.expectAsync1(((api.ListReposResponse response) { |
| 1024 checkListReposResponse(response); | 1026 checkListReposResponse(response); |
| 1025 }))); | 1027 }))); |
| 1026 }); | 1028 }); |
| 1027 | 1029 |
| 1028 unittest.test("method--setIamPolicy", () { | 1030 unittest.test("method--setIamPolicy", () { |
| 1029 | 1031 |
| 1030 var mock = new HttpServerMock(); | 1032 var mock = new HttpServerMock(); |
| 1031 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; | 1033 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; |
| 1032 var arg_request = buildSetIamPolicyRequest(); | 1034 var arg_request = buildSetIamPolicyRequest(); |
| 1033 var arg_resource = "foo"; | 1035 var arg_resource = "foo"; |
| 1034 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1036 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1035 var obj = new api.SetIamPolicyRequest.fromJson(json); | 1037 var obj = new api.SetIamPolicyRequest.fromJson(json); |
| 1036 checkSetIamPolicyRequest(obj); | 1038 checkSetIamPolicyRequest(obj); |
| 1037 | 1039 |
| 1038 var path = (req.url).path; | 1040 var path = (req.url).path; |
| 1039 var pathOffset = 0; | 1041 var pathOffset = 0; |
| 1040 var index; | 1042 var index; |
| 1041 var subPart; | 1043 var subPart; |
| 1042 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1044 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1043 pathOffset += 1; | 1045 pathOffset += 1; |
| 1044 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1046 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1062 } | 1064 } |
| 1063 } | 1065 } |
| 1064 | 1066 |
| 1065 | 1067 |
| 1066 var h = { | 1068 var h = { |
| 1067 "content-type" : "application/json; charset=utf-8", | 1069 "content-type" : "application/json; charset=utf-8", |
| 1068 }; | 1070 }; |
| 1069 var resp = convert.JSON.encode(buildPolicy()); | 1071 var resp = convert.JSON.encode(buildPolicy()); |
| 1070 return new async.Future.value(stringResponse(200, h, resp)); | 1072 return new async.Future.value(stringResponse(200, h, resp)); |
| 1071 }), true); | 1073 }), true); |
| 1072 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 1074 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { |
| 1073 checkPolicy(response); | 1075 checkPolicy(response); |
| 1074 }))); | 1076 }))); |
| 1075 }); | 1077 }); |
| 1076 | 1078 |
| 1077 unittest.test("method--testIamPermissions", () { | 1079 unittest.test("method--testIamPermissions", () { |
| 1078 | 1080 |
| 1079 var mock = new HttpServerMock(); | 1081 var mock = new HttpServerMock(); |
| 1080 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; | 1082 api.ProjectsReposResourceApi res = new api.SourcerepoApi(mock).projects.re
pos; |
| 1081 var arg_request = buildTestIamPermissionsRequest(); | 1083 var arg_request = buildTestIamPermissionsRequest(); |
| 1082 var arg_resource = "foo"; | 1084 var arg_resource = "foo"; |
| 1083 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1085 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1084 var obj = new api.TestIamPermissionsRequest.fromJson(json); | 1086 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| 1085 checkTestIamPermissionsRequest(obj); | 1087 checkTestIamPermissionsRequest(obj); |
| 1086 | 1088 |
| 1087 var path = (req.url).path; | 1089 var path = (req.url).path; |
| 1088 var pathOffset = 0; | 1090 var pathOffset = 0; |
| 1089 var index; | 1091 var index; |
| 1090 var subPart; | 1092 var subPart; |
| 1091 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1093 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1092 pathOffset += 1; | 1094 pathOffset += 1; |
| 1093 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1095 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1111 } | 1113 } |
| 1112 } | 1114 } |
| 1113 | 1115 |
| 1114 | 1116 |
| 1115 var h = { | 1117 var h = { |
| 1116 "content-type" : "application/json; charset=utf-8", | 1118 "content-type" : "application/json; charset=utf-8", |
| 1117 }; | 1119 }; |
| 1118 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); | 1120 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
| 1119 return new async.Future.value(stringResponse(200, h, resp)); | 1121 return new async.Future.value(stringResponse(200, h, resp)); |
| 1120 }), true); | 1122 }), true); |
| 1121 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c(((api.TestIamPermissionsResponse response) { | 1123 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c1(((api.TestIamPermissionsResponse response) { |
| 1122 checkTestIamPermissionsResponse(response); | 1124 checkTestIamPermissionsResponse(response); |
| 1123 }))); | 1125 }))); |
| 1124 }); | 1126 }); |
| 1125 | 1127 |
| 1126 }); | 1128 }); |
| 1127 | 1129 |
| 1128 | 1130 |
| 1129 } | 1131 } |
| 1130 | 1132 |
| OLD | NEW |