| OLD | NEW |
| 1 library googleapis_beta.runtimeconfig.v1beta1.test; | 1 library googleapis_beta.runtimeconfig.v1beta1.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 52 } |
| 53 | 53 |
| 54 buildUnnamed3551() { | 54 buildUnnamed3534() { |
| 55 var o = new core.List<core.String>(); | 55 var o = new core.List<core.String>(); |
| 56 o.add("foo"); | 56 o.add("foo"); |
| 57 o.add("foo"); | 57 o.add("foo"); |
| 58 return o; | 58 return o; |
| 59 } | 59 } |
| 60 | 60 |
| 61 checkUnnamed3551(core.List<core.String> o) { | 61 checkUnnamed3534(core.List<core.String> o) { |
| 62 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
| 63 unittest.expect(o[0], unittest.equals('foo')); | 63 unittest.expect(o[0], unittest.equals('foo')); |
| 64 unittest.expect(o[1], unittest.equals('foo')); | 64 unittest.expect(o[1], unittest.equals('foo')); |
| 65 } | 65 } |
| 66 | 66 |
| 67 core.int buildCounterBinding = 0; | 67 core.int buildCounterBinding = 0; |
| 68 buildBinding() { | 68 buildBinding() { |
| 69 var o = new api.Binding(); | 69 var o = new api.Binding(); |
| 70 buildCounterBinding++; | 70 buildCounterBinding++; |
| 71 if (buildCounterBinding < 3) { | 71 if (buildCounterBinding < 3) { |
| 72 o.members = buildUnnamed3551(); | 72 o.members = buildUnnamed3534(); |
| 73 o.role = "foo"; | 73 o.role = "foo"; |
| 74 } | 74 } |
| 75 buildCounterBinding--; | 75 buildCounterBinding--; |
| 76 return o; | 76 return o; |
| 77 } | 77 } |
| 78 | 78 |
| 79 checkBinding(api.Binding o) { | 79 checkBinding(api.Binding o) { |
| 80 buildCounterBinding++; | 80 buildCounterBinding++; |
| 81 if (buildCounterBinding < 3) { | 81 if (buildCounterBinding < 3) { |
| 82 checkUnnamed3551(o.members); | 82 checkUnnamed3534(o.members); |
| 83 unittest.expect(o.role, unittest.equals('foo')); | 83 unittest.expect(o.role, unittest.equals('foo')); |
| 84 } | 84 } |
| 85 buildCounterBinding--; | 85 buildCounterBinding--; |
| 86 } | 86 } |
| 87 | 87 |
| 88 core.int buildCounterCardinality = 0; | 88 core.int buildCounterCardinality = 0; |
| 89 buildCardinality() { | 89 buildCardinality() { |
| 90 var o = new api.Cardinality(); | 90 var o = new api.Cardinality(); |
| 91 buildCounterCardinality++; | 91 buildCounterCardinality++; |
| 92 if (buildCounterCardinality < 3) { | 92 if (buildCounterCardinality < 3) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 135 } |
| 136 | 136 |
| 137 checkEndCondition(api.EndCondition o) { | 137 checkEndCondition(api.EndCondition o) { |
| 138 buildCounterEndCondition++; | 138 buildCounterEndCondition++; |
| 139 if (buildCounterEndCondition < 3) { | 139 if (buildCounterEndCondition < 3) { |
| 140 checkCardinality(o.cardinality); | 140 checkCardinality(o.cardinality); |
| 141 } | 141 } |
| 142 buildCounterEndCondition--; | 142 buildCounterEndCondition--; |
| 143 } | 143 } |
| 144 | 144 |
| 145 buildUnnamed3552() { | 145 buildUnnamed3535() { |
| 146 var o = new core.List<api.RuntimeConfig>(); | 146 var o = new core.List<api.RuntimeConfig>(); |
| 147 o.add(buildRuntimeConfig()); | 147 o.add(buildRuntimeConfig()); |
| 148 o.add(buildRuntimeConfig()); | 148 o.add(buildRuntimeConfig()); |
| 149 return o; | 149 return o; |
| 150 } | 150 } |
| 151 | 151 |
| 152 checkUnnamed3552(core.List<api.RuntimeConfig> o) { | 152 checkUnnamed3535(core.List<api.RuntimeConfig> o) { |
| 153 unittest.expect(o, unittest.hasLength(2)); | 153 unittest.expect(o, unittest.hasLength(2)); |
| 154 checkRuntimeConfig(o[0]); | 154 checkRuntimeConfig(o[0]); |
| 155 checkRuntimeConfig(o[1]); | 155 checkRuntimeConfig(o[1]); |
| 156 } | 156 } |
| 157 | 157 |
| 158 core.int buildCounterListConfigsResponse = 0; | 158 core.int buildCounterListConfigsResponse = 0; |
| 159 buildListConfigsResponse() { | 159 buildListConfigsResponse() { |
| 160 var o = new api.ListConfigsResponse(); | 160 var o = new api.ListConfigsResponse(); |
| 161 buildCounterListConfigsResponse++; | 161 buildCounterListConfigsResponse++; |
| 162 if (buildCounterListConfigsResponse < 3) { | 162 if (buildCounterListConfigsResponse < 3) { |
| 163 o.configs = buildUnnamed3552(); | 163 o.configs = buildUnnamed3535(); |
| 164 o.nextPageToken = "foo"; | 164 o.nextPageToken = "foo"; |
| 165 } | 165 } |
| 166 buildCounterListConfigsResponse--; | 166 buildCounterListConfigsResponse--; |
| 167 return o; | 167 return o; |
| 168 } | 168 } |
| 169 | 169 |
| 170 checkListConfigsResponse(api.ListConfigsResponse o) { | 170 checkListConfigsResponse(api.ListConfigsResponse o) { |
| 171 buildCounterListConfigsResponse++; | 171 buildCounterListConfigsResponse++; |
| 172 if (buildCounterListConfigsResponse < 3) { | 172 if (buildCounterListConfigsResponse < 3) { |
| 173 checkUnnamed3552(o.configs); | 173 checkUnnamed3535(o.configs); |
| 174 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 174 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 175 } | 175 } |
| 176 buildCounterListConfigsResponse--; | 176 buildCounterListConfigsResponse--; |
| 177 } | 177 } |
| 178 | 178 |
| 179 buildUnnamed3553() { | 179 buildUnnamed3536() { |
| 180 var o = new core.List<api.Variable>(); | 180 var o = new core.List<api.Variable>(); |
| 181 o.add(buildVariable()); | 181 o.add(buildVariable()); |
| 182 o.add(buildVariable()); | 182 o.add(buildVariable()); |
| 183 return o; | 183 return o; |
| 184 } | 184 } |
| 185 | 185 |
| 186 checkUnnamed3553(core.List<api.Variable> o) { | 186 checkUnnamed3536(core.List<api.Variable> o) { |
| 187 unittest.expect(o, unittest.hasLength(2)); | 187 unittest.expect(o, unittest.hasLength(2)); |
| 188 checkVariable(o[0]); | 188 checkVariable(o[0]); |
| 189 checkVariable(o[1]); | 189 checkVariable(o[1]); |
| 190 } | 190 } |
| 191 | 191 |
| 192 core.int buildCounterListVariablesResponse = 0; | 192 core.int buildCounterListVariablesResponse = 0; |
| 193 buildListVariablesResponse() { | 193 buildListVariablesResponse() { |
| 194 var o = new api.ListVariablesResponse(); | 194 var o = new api.ListVariablesResponse(); |
| 195 buildCounterListVariablesResponse++; | 195 buildCounterListVariablesResponse++; |
| 196 if (buildCounterListVariablesResponse < 3) { | 196 if (buildCounterListVariablesResponse < 3) { |
| 197 o.nextPageToken = "foo"; | 197 o.nextPageToken = "foo"; |
| 198 o.variables = buildUnnamed3553(); | 198 o.variables = buildUnnamed3536(); |
| 199 } | 199 } |
| 200 buildCounterListVariablesResponse--; | 200 buildCounterListVariablesResponse--; |
| 201 return o; | 201 return o; |
| 202 } | 202 } |
| 203 | 203 |
| 204 checkListVariablesResponse(api.ListVariablesResponse o) { | 204 checkListVariablesResponse(api.ListVariablesResponse o) { |
| 205 buildCounterListVariablesResponse++; | 205 buildCounterListVariablesResponse++; |
| 206 if (buildCounterListVariablesResponse < 3) { | 206 if (buildCounterListVariablesResponse < 3) { |
| 207 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 207 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 208 checkUnnamed3553(o.variables); | 208 checkUnnamed3536(o.variables); |
| 209 } | 209 } |
| 210 buildCounterListVariablesResponse--; | 210 buildCounterListVariablesResponse--; |
| 211 } | 211 } |
| 212 | 212 |
| 213 buildUnnamed3554() { | 213 buildUnnamed3537() { |
| 214 var o = new core.List<api.Waiter>(); | 214 var o = new core.List<api.Waiter>(); |
| 215 o.add(buildWaiter()); | 215 o.add(buildWaiter()); |
| 216 o.add(buildWaiter()); | 216 o.add(buildWaiter()); |
| 217 return o; | 217 return o; |
| 218 } | 218 } |
| 219 | 219 |
| 220 checkUnnamed3554(core.List<api.Waiter> o) { | 220 checkUnnamed3537(core.List<api.Waiter> o) { |
| 221 unittest.expect(o, unittest.hasLength(2)); | 221 unittest.expect(o, unittest.hasLength(2)); |
| 222 checkWaiter(o[0]); | 222 checkWaiter(o[0]); |
| 223 checkWaiter(o[1]); | 223 checkWaiter(o[1]); |
| 224 } | 224 } |
| 225 | 225 |
| 226 core.int buildCounterListWaitersResponse = 0; | 226 core.int buildCounterListWaitersResponse = 0; |
| 227 buildListWaitersResponse() { | 227 buildListWaitersResponse() { |
| 228 var o = new api.ListWaitersResponse(); | 228 var o = new api.ListWaitersResponse(); |
| 229 buildCounterListWaitersResponse++; | 229 buildCounterListWaitersResponse++; |
| 230 if (buildCounterListWaitersResponse < 3) { | 230 if (buildCounterListWaitersResponse < 3) { |
| 231 o.nextPageToken = "foo"; | 231 o.nextPageToken = "foo"; |
| 232 o.waiters = buildUnnamed3554(); | 232 o.waiters = buildUnnamed3537(); |
| 233 } | 233 } |
| 234 buildCounterListWaitersResponse--; | 234 buildCounterListWaitersResponse--; |
| 235 return o; | 235 return o; |
| 236 } | 236 } |
| 237 | 237 |
| 238 checkListWaitersResponse(api.ListWaitersResponse o) { | 238 checkListWaitersResponse(api.ListWaitersResponse o) { |
| 239 buildCounterListWaitersResponse++; | 239 buildCounterListWaitersResponse++; |
| 240 if (buildCounterListWaitersResponse < 3) { | 240 if (buildCounterListWaitersResponse < 3) { |
| 241 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 241 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 242 checkUnnamed3554(o.waiters); | 242 checkUnnamed3537(o.waiters); |
| 243 } | 243 } |
| 244 buildCounterListWaitersResponse--; | 244 buildCounterListWaitersResponse--; |
| 245 } | 245 } |
| 246 | 246 |
| 247 buildUnnamed3555() { | 247 buildUnnamed3538() { |
| 248 var o = new core.Map<core.String, core.Object>(); | 248 var o = new core.Map<core.String, core.Object>(); |
| 249 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 249 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 250 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 250 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 251 return o; | 251 return o; |
| 252 } | 252 } |
| 253 | 253 |
| 254 checkUnnamed3555(core.Map<core.String, core.Object> o) { | 254 checkUnnamed3538(core.Map<core.String, core.Object> o) { |
| 255 unittest.expect(o, unittest.hasLength(2)); | 255 unittest.expect(o, unittest.hasLength(2)); |
| 256 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); | 256 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); |
| 257 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); | 257 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); |
| 258 } | 258 } |
| 259 | 259 |
| 260 buildUnnamed3556() { | 260 buildUnnamed3539() { |
| 261 var o = new core.Map<core.String, core.Object>(); | 261 var o = new core.Map<core.String, core.Object>(); |
| 262 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 262 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 263 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 263 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 264 return o; | 264 return o; |
| 265 } | 265 } |
| 266 | 266 |
| 267 checkUnnamed3556(core.Map<core.String, core.Object> o) { | 267 checkUnnamed3539(core.Map<core.String, core.Object> o) { |
| 268 unittest.expect(o, unittest.hasLength(2)); | 268 unittest.expect(o, unittest.hasLength(2)); |
| 269 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); | 269 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); |
| 270 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); | 270 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); |
| 271 } | 271 } |
| 272 | 272 |
| 273 core.int buildCounterOperation = 0; | 273 core.int buildCounterOperation = 0; |
| 274 buildOperation() { | 274 buildOperation() { |
| 275 var o = new api.Operation(); | 275 var o = new api.Operation(); |
| 276 buildCounterOperation++; | 276 buildCounterOperation++; |
| 277 if (buildCounterOperation < 3) { | 277 if (buildCounterOperation < 3) { |
| 278 o.done = true; | 278 o.done = true; |
| 279 o.error = buildStatus(); | 279 o.error = buildStatus(); |
| 280 o.metadata = buildUnnamed3555(); | 280 o.metadata = buildUnnamed3538(); |
| 281 o.name = "foo"; | 281 o.name = "foo"; |
| 282 o.response = buildUnnamed3556(); | 282 o.response = buildUnnamed3539(); |
| 283 } | 283 } |
| 284 buildCounterOperation--; | 284 buildCounterOperation--; |
| 285 return o; | 285 return o; |
| 286 } | 286 } |
| 287 | 287 |
| 288 checkOperation(api.Operation o) { | 288 checkOperation(api.Operation o) { |
| 289 buildCounterOperation++; | 289 buildCounterOperation++; |
| 290 if (buildCounterOperation < 3) { | 290 if (buildCounterOperation < 3) { |
| 291 unittest.expect(o.done, unittest.isTrue); | 291 unittest.expect(o.done, unittest.isTrue); |
| 292 checkStatus(o.error); | 292 checkStatus(o.error); |
| 293 checkUnnamed3555(o.metadata); | 293 checkUnnamed3538(o.metadata); |
| 294 unittest.expect(o.name, unittest.equals('foo')); | 294 unittest.expect(o.name, unittest.equals('foo')); |
| 295 checkUnnamed3556(o.response); | 295 checkUnnamed3539(o.response); |
| 296 } | 296 } |
| 297 buildCounterOperation--; | 297 buildCounterOperation--; |
| 298 } | 298 } |
| 299 | 299 |
| 300 buildUnnamed3557() { | 300 buildUnnamed3540() { |
| 301 var o = new core.List<api.Binding>(); | 301 var o = new core.List<api.Binding>(); |
| 302 o.add(buildBinding()); | 302 o.add(buildBinding()); |
| 303 o.add(buildBinding()); | 303 o.add(buildBinding()); |
| 304 return o; | 304 return o; |
| 305 } | 305 } |
| 306 | 306 |
| 307 checkUnnamed3557(core.List<api.Binding> o) { | 307 checkUnnamed3540(core.List<api.Binding> o) { |
| 308 unittest.expect(o, unittest.hasLength(2)); | 308 unittest.expect(o, unittest.hasLength(2)); |
| 309 checkBinding(o[0]); | 309 checkBinding(o[0]); |
| 310 checkBinding(o[1]); | 310 checkBinding(o[1]); |
| 311 } | 311 } |
| 312 | 312 |
| 313 core.int buildCounterPolicy = 0; | 313 core.int buildCounterPolicy = 0; |
| 314 buildPolicy() { | 314 buildPolicy() { |
| 315 var o = new api.Policy(); | 315 var o = new api.Policy(); |
| 316 buildCounterPolicy++; | 316 buildCounterPolicy++; |
| 317 if (buildCounterPolicy < 3) { | 317 if (buildCounterPolicy < 3) { |
| 318 o.bindings = buildUnnamed3557(); | 318 o.bindings = buildUnnamed3540(); |
| 319 o.etag = "foo"; | 319 o.etag = "foo"; |
| 320 o.version = 42; | 320 o.version = 42; |
| 321 } | 321 } |
| 322 buildCounterPolicy--; | 322 buildCounterPolicy--; |
| 323 return o; | 323 return o; |
| 324 } | 324 } |
| 325 | 325 |
| 326 checkPolicy(api.Policy o) { | 326 checkPolicy(api.Policy o) { |
| 327 buildCounterPolicy++; | 327 buildCounterPolicy++; |
| 328 if (buildCounterPolicy < 3) { | 328 if (buildCounterPolicy < 3) { |
| 329 checkUnnamed3557(o.bindings); | 329 checkUnnamed3540(o.bindings); |
| 330 unittest.expect(o.etag, unittest.equals('foo')); | 330 unittest.expect(o.etag, unittest.equals('foo')); |
| 331 unittest.expect(o.version, unittest.equals(42)); | 331 unittest.expect(o.version, unittest.equals(42)); |
| 332 } | 332 } |
| 333 buildCounterPolicy--; | 333 buildCounterPolicy--; |
| 334 } | 334 } |
| 335 | 335 |
| 336 core.int buildCounterRuntimeConfig = 0; | 336 core.int buildCounterRuntimeConfig = 0; |
| 337 buildRuntimeConfig() { | 337 buildRuntimeConfig() { |
| 338 var o = new api.RuntimeConfig(); | 338 var o = new api.RuntimeConfig(); |
| 339 buildCounterRuntimeConfig++; | 339 buildCounterRuntimeConfig++; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 366 } | 366 } |
| 367 | 367 |
| 368 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { | 368 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
| 369 buildCounterSetIamPolicyRequest++; | 369 buildCounterSetIamPolicyRequest++; |
| 370 if (buildCounterSetIamPolicyRequest < 3) { | 370 if (buildCounterSetIamPolicyRequest < 3) { |
| 371 checkPolicy(o.policy); | 371 checkPolicy(o.policy); |
| 372 } | 372 } |
| 373 buildCounterSetIamPolicyRequest--; | 373 buildCounterSetIamPolicyRequest--; |
| 374 } | 374 } |
| 375 | 375 |
| 376 buildUnnamed3558() { | 376 buildUnnamed3541() { |
| 377 var o = new core.Map<core.String, core.Object>(); | 377 var o = new core.Map<core.String, core.Object>(); |
| 378 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 378 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 379 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 379 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 380 return o; | 380 return o; |
| 381 } | 381 } |
| 382 | 382 |
| 383 checkUnnamed3558(core.Map<core.String, core.Object> o) { | 383 checkUnnamed3541(core.Map<core.String, core.Object> o) { |
| 384 unittest.expect(o, unittest.hasLength(2)); | 384 unittest.expect(o, unittest.hasLength(2)); |
| 385 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); | 385 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); |
| 386 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); | 386 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); |
| 387 } | 387 } |
| 388 | 388 |
| 389 buildUnnamed3559() { | 389 buildUnnamed3542() { |
| 390 var o = new core.List<core.Map<core.String, core.Object>>(); | 390 var o = new core.List<core.Map<core.String, core.Object>>(); |
| 391 o.add(buildUnnamed3558()); | 391 o.add(buildUnnamed3541()); |
| 392 o.add(buildUnnamed3558()); | 392 o.add(buildUnnamed3541()); |
| 393 return o; | 393 return o; |
| 394 } | 394 } |
| 395 | 395 |
| 396 checkUnnamed3559(core.List<core.Map<core.String, core.Object>> o) { | 396 checkUnnamed3542(core.List<core.Map<core.String, core.Object>> o) { |
| 397 unittest.expect(o, unittest.hasLength(2)); | 397 unittest.expect(o, unittest.hasLength(2)); |
| 398 checkUnnamed3558(o[0]); | 398 checkUnnamed3541(o[0]); |
| 399 checkUnnamed3558(o[1]); | 399 checkUnnamed3541(o[1]); |
| 400 } | 400 } |
| 401 | 401 |
| 402 core.int buildCounterStatus = 0; | 402 core.int buildCounterStatus = 0; |
| 403 buildStatus() { | 403 buildStatus() { |
| 404 var o = new api.Status(); | 404 var o = new api.Status(); |
| 405 buildCounterStatus++; | 405 buildCounterStatus++; |
| 406 if (buildCounterStatus < 3) { | 406 if (buildCounterStatus < 3) { |
| 407 o.code = 42; | 407 o.code = 42; |
| 408 o.details = buildUnnamed3559(); | 408 o.details = buildUnnamed3542(); |
| 409 o.message = "foo"; | 409 o.message = "foo"; |
| 410 } | 410 } |
| 411 buildCounterStatus--; | 411 buildCounterStatus--; |
| 412 return o; | 412 return o; |
| 413 } | 413 } |
| 414 | 414 |
| 415 checkStatus(api.Status o) { | 415 checkStatus(api.Status o) { |
| 416 buildCounterStatus++; | 416 buildCounterStatus++; |
| 417 if (buildCounterStatus < 3) { | 417 if (buildCounterStatus < 3) { |
| 418 unittest.expect(o.code, unittest.equals(42)); | 418 unittest.expect(o.code, unittest.equals(42)); |
| 419 checkUnnamed3559(o.details); | 419 checkUnnamed3542(o.details); |
| 420 unittest.expect(o.message, unittest.equals('foo')); | 420 unittest.expect(o.message, unittest.equals('foo')); |
| 421 } | 421 } |
| 422 buildCounterStatus--; | 422 buildCounterStatus--; |
| 423 } | 423 } |
| 424 | 424 |
| 425 buildUnnamed3560() { | 425 buildUnnamed3543() { |
| 426 var o = new core.List<core.String>(); | 426 var o = new core.List<core.String>(); |
| 427 o.add("foo"); | 427 o.add("foo"); |
| 428 o.add("foo"); | 428 o.add("foo"); |
| 429 return o; | 429 return o; |
| 430 } | 430 } |
| 431 | 431 |
| 432 checkUnnamed3560(core.List<core.String> o) { | 432 checkUnnamed3543(core.List<core.String> o) { |
| 433 unittest.expect(o, unittest.hasLength(2)); | 433 unittest.expect(o, unittest.hasLength(2)); |
| 434 unittest.expect(o[0], unittest.equals('foo')); | 434 unittest.expect(o[0], unittest.equals('foo')); |
| 435 unittest.expect(o[1], unittest.equals('foo')); | 435 unittest.expect(o[1], unittest.equals('foo')); |
| 436 } | 436 } |
| 437 | 437 |
| 438 core.int buildCounterTestIamPermissionsRequest = 0; | 438 core.int buildCounterTestIamPermissionsRequest = 0; |
| 439 buildTestIamPermissionsRequest() { | 439 buildTestIamPermissionsRequest() { |
| 440 var o = new api.TestIamPermissionsRequest(); | 440 var o = new api.TestIamPermissionsRequest(); |
| 441 buildCounterTestIamPermissionsRequest++; | 441 buildCounterTestIamPermissionsRequest++; |
| 442 if (buildCounterTestIamPermissionsRequest < 3) { | 442 if (buildCounterTestIamPermissionsRequest < 3) { |
| 443 o.permissions = buildUnnamed3560(); | 443 o.permissions = buildUnnamed3543(); |
| 444 } | 444 } |
| 445 buildCounterTestIamPermissionsRequest--; | 445 buildCounterTestIamPermissionsRequest--; |
| 446 return o; | 446 return o; |
| 447 } | 447 } |
| 448 | 448 |
| 449 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { | 449 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| 450 buildCounterTestIamPermissionsRequest++; | 450 buildCounterTestIamPermissionsRequest++; |
| 451 if (buildCounterTestIamPermissionsRequest < 3) { | 451 if (buildCounterTestIamPermissionsRequest < 3) { |
| 452 checkUnnamed3560(o.permissions); | 452 checkUnnamed3543(o.permissions); |
| 453 } | 453 } |
| 454 buildCounterTestIamPermissionsRequest--; | 454 buildCounterTestIamPermissionsRequest--; |
| 455 } | 455 } |
| 456 | 456 |
| 457 buildUnnamed3561() { | 457 buildUnnamed3544() { |
| 458 var o = new core.List<core.String>(); | 458 var o = new core.List<core.String>(); |
| 459 o.add("foo"); | 459 o.add("foo"); |
| 460 o.add("foo"); | 460 o.add("foo"); |
| 461 return o; | 461 return o; |
| 462 } | 462 } |
| 463 | 463 |
| 464 checkUnnamed3561(core.List<core.String> o) { | 464 checkUnnamed3544(core.List<core.String> o) { |
| 465 unittest.expect(o, unittest.hasLength(2)); | 465 unittest.expect(o, unittest.hasLength(2)); |
| 466 unittest.expect(o[0], unittest.equals('foo')); | 466 unittest.expect(o[0], unittest.equals('foo')); |
| 467 unittest.expect(o[1], unittest.equals('foo')); | 467 unittest.expect(o[1], unittest.equals('foo')); |
| 468 } | 468 } |
| 469 | 469 |
| 470 core.int buildCounterTestIamPermissionsResponse = 0; | 470 core.int buildCounterTestIamPermissionsResponse = 0; |
| 471 buildTestIamPermissionsResponse() { | 471 buildTestIamPermissionsResponse() { |
| 472 var o = new api.TestIamPermissionsResponse(); | 472 var o = new api.TestIamPermissionsResponse(); |
| 473 buildCounterTestIamPermissionsResponse++; | 473 buildCounterTestIamPermissionsResponse++; |
| 474 if (buildCounterTestIamPermissionsResponse < 3) { | 474 if (buildCounterTestIamPermissionsResponse < 3) { |
| 475 o.permissions = buildUnnamed3561(); | 475 o.permissions = buildUnnamed3544(); |
| 476 } | 476 } |
| 477 buildCounterTestIamPermissionsResponse--; | 477 buildCounterTestIamPermissionsResponse--; |
| 478 return o; | 478 return o; |
| 479 } | 479 } |
| 480 | 480 |
| 481 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { | 481 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| 482 buildCounterTestIamPermissionsResponse++; | 482 buildCounterTestIamPermissionsResponse++; |
| 483 if (buildCounterTestIamPermissionsResponse < 3) { | 483 if (buildCounterTestIamPermissionsResponse < 3) { |
| 484 checkUnnamed3561(o.permissions); | 484 checkUnnamed3544(o.permissions); |
| 485 } | 485 } |
| 486 buildCounterTestIamPermissionsResponse--; | 486 buildCounterTestIamPermissionsResponse--; |
| 487 } | 487 } |
| 488 | 488 |
| 489 core.int buildCounterVariable = 0; | 489 core.int buildCounterVariable = 0; |
| 490 buildVariable() { | 490 buildVariable() { |
| 491 var o = new api.Variable(); | 491 var o = new api.Variable(); |
| 492 buildCounterVariable++; | 492 buildCounterVariable++; |
| 493 if (buildCounterVariable < 3) { | 493 if (buildCounterVariable < 3) { |
| 494 o.name = "foo"; | 494 o.name = "foo"; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 } | 556 } |
| 557 | 557 |
| 558 checkWatchVariableRequest(api.WatchVariableRequest o) { | 558 checkWatchVariableRequest(api.WatchVariableRequest o) { |
| 559 buildCounterWatchVariableRequest++; | 559 buildCounterWatchVariableRequest++; |
| 560 if (buildCounterWatchVariableRequest < 3) { | 560 if (buildCounterWatchVariableRequest < 3) { |
| 561 unittest.expect(o.newerThan, unittest.equals('foo')); | 561 unittest.expect(o.newerThan, unittest.equals('foo')); |
| 562 } | 562 } |
| 563 buildCounterWatchVariableRequest--; | 563 buildCounterWatchVariableRequest--; |
| 564 } | 564 } |
| 565 | 565 |
| 566 buildUnnamed3562() { | |
| 567 var o = new core.List<core.String>(); | |
| 568 o.add("foo"); | |
| 569 o.add("foo"); | |
| 570 return o; | |
| 571 } | |
| 572 | |
| 573 checkUnnamed3562(core.List<core.String> o) { | |
| 574 unittest.expect(o, unittest.hasLength(2)); | |
| 575 unittest.expect(o[0], unittest.equals('foo')); | |
| 576 unittest.expect(o[1], unittest.equals('foo')); | |
| 577 } | |
| 578 | |
| 579 buildUnnamed3563() { | |
| 580 var o = new core.List<core.String>(); | |
| 581 o.add("foo"); | |
| 582 o.add("foo"); | |
| 583 return o; | |
| 584 } | |
| 585 | |
| 586 checkUnnamed3563(core.List<core.String> o) { | |
| 587 unittest.expect(o, unittest.hasLength(2)); | |
| 588 unittest.expect(o[0], unittest.equals('foo')); | |
| 589 unittest.expect(o[1], unittest.equals('foo')); | |
| 590 } | |
| 591 | |
| 592 buildUnnamed3564() { | |
| 593 var o = new core.List<core.String>(); | |
| 594 o.add("foo"); | |
| 595 o.add("foo"); | |
| 596 return o; | |
| 597 } | |
| 598 | |
| 599 checkUnnamed3564(core.List<core.String> o) { | |
| 600 unittest.expect(o, unittest.hasLength(2)); | |
| 601 unittest.expect(o[0], unittest.equals('foo')); | |
| 602 unittest.expect(o[1], unittest.equals('foo')); | |
| 603 } | |
| 604 | |
| 605 | 566 |
| 606 main() { | 567 main() { |
| 607 unittest.group("obj-schema-Binding", () { | 568 unittest.group("obj-schema-Binding", () { |
| 608 unittest.test("to-json--from-json", () { | 569 unittest.test("to-json--from-json", () { |
| 609 var o = buildBinding(); | 570 var o = buildBinding(); |
| 610 var od = new api.Binding.fromJson(o.toJson()); | 571 var od = new api.Binding.fromJson(o.toJson()); |
| 611 checkBinding(od); | 572 checkBinding(od); |
| 612 }); | 573 }); |
| 613 }); | 574 }); |
| 614 | 575 |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 }), true); | 1147 }), true); |
| 1187 res.get(arg_name).then(unittest.expectAsync(((api.Operation response) { | 1148 res.get(arg_name).then(unittest.expectAsync(((api.Operation response) { |
| 1188 checkOperation(response); | 1149 checkOperation(response); |
| 1189 }))); | 1150 }))); |
| 1190 }); | 1151 }); |
| 1191 | 1152 |
| 1192 unittest.test("method--testIamPermissions", () { | 1153 unittest.test("method--testIamPermissions", () { |
| 1193 | 1154 |
| 1194 var mock = new HttpServerMock(); | 1155 var mock = new HttpServerMock(); |
| 1195 api.ProjectsConfigsOperationsResourceApi res = new api.RuntimeconfigApi(mo
ck).projects.configs.operations; | 1156 api.ProjectsConfigsOperationsResourceApi res = new api.RuntimeconfigApi(mo
ck).projects.configs.operations; |
| 1157 var arg_request = buildTestIamPermissionsRequest(); |
| 1196 var arg_resource = "foo"; | 1158 var arg_resource = "foo"; |
| 1197 var arg_permissions = buildUnnamed3562(); | |
| 1198 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1159 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1160 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| 1161 checkTestIamPermissionsRequest(obj); |
| 1162 |
| 1199 var path = (req.url).path; | 1163 var path = (req.url).path; |
| 1200 var pathOffset = 0; | 1164 var pathOffset = 0; |
| 1201 var index; | 1165 var index; |
| 1202 var subPart; | 1166 var subPart; |
| 1203 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1167 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1204 pathOffset += 1; | 1168 pathOffset += 1; |
| 1205 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 1169 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| 1206 pathOffset += 8; | 1170 pathOffset += 8; |
| 1207 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1171 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1208 | 1172 |
| 1209 var query = (req.url).query; | 1173 var query = (req.url).query; |
| 1210 var queryOffset = 0; | 1174 var queryOffset = 0; |
| 1211 var queryMap = {}; | 1175 var queryMap = {}; |
| 1212 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1176 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1213 parseBool(n) { | 1177 parseBool(n) { |
| 1214 if (n == "true") return true; | 1178 if (n == "true") return true; |
| 1215 if (n == "false") return false; | 1179 if (n == "false") return false; |
| 1216 if (n == null) return null; | 1180 if (n == null) return null; |
| 1217 throw new core.ArgumentError("Invalid boolean: $n"); | 1181 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1218 } | 1182 } |
| 1219 if (query.length > 0) { | 1183 if (query.length > 0) { |
| 1220 for (var part in query.split("&")) { | 1184 for (var part in query.split("&")) { |
| 1221 var keyvalue = part.split("="); | 1185 var keyvalue = part.split("="); |
| 1222 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1186 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1223 } | 1187 } |
| 1224 } | 1188 } |
| 1225 unittest.expect(queryMap["permissions"], unittest.equals(arg_permissions
)); | |
| 1226 | 1189 |
| 1227 | 1190 |
| 1228 var h = { | 1191 var h = { |
| 1229 "content-type" : "application/json; charset=utf-8", | 1192 "content-type" : "application/json; charset=utf-8", |
| 1230 }; | 1193 }; |
| 1231 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); | 1194 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
| 1232 return new async.Future.value(stringResponse(200, h, resp)); | 1195 return new async.Future.value(stringResponse(200, h, resp)); |
| 1233 }), true); | 1196 }), true); |
| 1234 res.testIamPermissions(arg_resource, permissions: arg_permissions).then(un
ittest.expectAsync(((api.TestIamPermissionsResponse response) { | 1197 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c(((api.TestIamPermissionsResponse response) { |
| 1235 checkTestIamPermissionsResponse(response); | 1198 checkTestIamPermissionsResponse(response); |
| 1236 }))); | 1199 }))); |
| 1237 }); | 1200 }); |
| 1238 | 1201 |
| 1239 }); | 1202 }); |
| 1240 | 1203 |
| 1241 | 1204 |
| 1242 unittest.group("resource-ProjectsConfigsVariablesResourceApi", () { | 1205 unittest.group("resource-ProjectsConfigsVariablesResourceApi", () { |
| 1243 unittest.test("method--create", () { | 1206 unittest.test("method--create", () { |
| 1244 | 1207 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1381 res.get(arg_name).then(unittest.expectAsync(((api.Variable response) { | 1344 res.get(arg_name).then(unittest.expectAsync(((api.Variable response) { |
| 1382 checkVariable(response); | 1345 checkVariable(response); |
| 1383 }))); | 1346 }))); |
| 1384 }); | 1347 }); |
| 1385 | 1348 |
| 1386 unittest.test("method--list", () { | 1349 unittest.test("method--list", () { |
| 1387 | 1350 |
| 1388 var mock = new HttpServerMock(); | 1351 var mock = new HttpServerMock(); |
| 1389 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc
k).projects.configs.variables; | 1352 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc
k).projects.configs.variables; |
| 1390 var arg_parent = "foo"; | 1353 var arg_parent = "foo"; |
| 1391 var arg_filter = "foo"; | |
| 1392 var arg_pageToken = "foo"; | 1354 var arg_pageToken = "foo"; |
| 1393 var arg_returnValues = true; | 1355 var arg_returnValues = true; |
| 1394 var arg_pageSize = 42; | 1356 var arg_pageSize = 42; |
| 1357 var arg_filter = "foo"; |
| 1395 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1358 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1396 var path = (req.url).path; | 1359 var path = (req.url).path; |
| 1397 var pathOffset = 0; | 1360 var pathOffset = 0; |
| 1398 var index; | 1361 var index; |
| 1399 var subPart; | 1362 var subPart; |
| 1400 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1363 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1401 pathOffset += 1; | 1364 pathOffset += 1; |
| 1402 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 1365 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| 1403 pathOffset += 8; | 1366 pathOffset += 8; |
| 1404 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1367 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1405 | 1368 |
| 1406 var query = (req.url).query; | 1369 var query = (req.url).query; |
| 1407 var queryOffset = 0; | 1370 var queryOffset = 0; |
| 1408 var queryMap = {}; | 1371 var queryMap = {}; |
| 1409 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1372 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1410 parseBool(n) { | 1373 parseBool(n) { |
| 1411 if (n == "true") return true; | 1374 if (n == "true") return true; |
| 1412 if (n == "false") return false; | 1375 if (n == "false") return false; |
| 1413 if (n == null) return null; | 1376 if (n == null) return null; |
| 1414 throw new core.ArgumentError("Invalid boolean: $n"); | 1377 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1415 } | 1378 } |
| 1416 if (query.length > 0) { | 1379 if (query.length > 0) { |
| 1417 for (var part in query.split("&")) { | 1380 for (var part in query.split("&")) { |
| 1418 var keyvalue = part.split("="); | 1381 var keyvalue = part.split("="); |
| 1419 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1382 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1420 } | 1383 } |
| 1421 } | 1384 } |
| 1422 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | |
| 1423 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1385 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1424 unittest.expect(queryMap["returnValues"].first, unittest.equals("$arg_re
turnValues")); | 1386 unittest.expect(queryMap["returnValues"].first, unittest.equals("$arg_re
turnValues")); |
| 1425 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1387 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1388 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 1426 | 1389 |
| 1427 | 1390 |
| 1428 var h = { | 1391 var h = { |
| 1429 "content-type" : "application/json; charset=utf-8", | 1392 "content-type" : "application/json; charset=utf-8", |
| 1430 }; | 1393 }; |
| 1431 var resp = convert.JSON.encode(buildListVariablesResponse()); | 1394 var resp = convert.JSON.encode(buildListVariablesResponse()); |
| 1432 return new async.Future.value(stringResponse(200, h, resp)); | 1395 return new async.Future.value(stringResponse(200, h, resp)); |
| 1433 }), true); | 1396 }), true); |
| 1434 res.list(arg_parent, filter: arg_filter, pageToken: arg_pageToken, returnV
alues: arg_returnValues, pageSize: arg_pageSize).then(unittest.expectAsync(((api
.ListVariablesResponse response) { | 1397 res.list(arg_parent, pageToken: arg_pageToken, returnValues: arg_returnVal
ues, pageSize: arg_pageSize, filter: arg_filter).then(unittest.expectAsync(((api
.ListVariablesResponse response) { |
| 1435 checkListVariablesResponse(response); | 1398 checkListVariablesResponse(response); |
| 1436 }))); | 1399 }))); |
| 1437 }); | 1400 }); |
| 1438 | 1401 |
| 1439 unittest.test("method--testIamPermissions", () { | 1402 unittest.test("method--testIamPermissions", () { |
| 1440 | 1403 |
| 1441 var mock = new HttpServerMock(); | 1404 var mock = new HttpServerMock(); |
| 1442 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc
k).projects.configs.variables; | 1405 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc
k).projects.configs.variables; |
| 1406 var arg_request = buildTestIamPermissionsRequest(); |
| 1443 var arg_resource = "foo"; | 1407 var arg_resource = "foo"; |
| 1444 var arg_permissions = buildUnnamed3563(); | |
| 1445 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1408 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1409 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| 1410 checkTestIamPermissionsRequest(obj); |
| 1411 |
| 1446 var path = (req.url).path; | 1412 var path = (req.url).path; |
| 1447 var pathOffset = 0; | 1413 var pathOffset = 0; |
| 1448 var index; | 1414 var index; |
| 1449 var subPart; | 1415 var subPart; |
| 1450 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1416 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1451 pathOffset += 1; | 1417 pathOffset += 1; |
| 1452 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 1418 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| 1453 pathOffset += 8; | 1419 pathOffset += 8; |
| 1454 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1420 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1455 | 1421 |
| 1456 var query = (req.url).query; | 1422 var query = (req.url).query; |
| 1457 var queryOffset = 0; | 1423 var queryOffset = 0; |
| 1458 var queryMap = {}; | 1424 var queryMap = {}; |
| 1459 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1425 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1460 parseBool(n) { | 1426 parseBool(n) { |
| 1461 if (n == "true") return true; | 1427 if (n == "true") return true; |
| 1462 if (n == "false") return false; | 1428 if (n == "false") return false; |
| 1463 if (n == null) return null; | 1429 if (n == null) return null; |
| 1464 throw new core.ArgumentError("Invalid boolean: $n"); | 1430 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1465 } | 1431 } |
| 1466 if (query.length > 0) { | 1432 if (query.length > 0) { |
| 1467 for (var part in query.split("&")) { | 1433 for (var part in query.split("&")) { |
| 1468 var keyvalue = part.split("="); | 1434 var keyvalue = part.split("="); |
| 1469 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1435 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1470 } | 1436 } |
| 1471 } | 1437 } |
| 1472 unittest.expect(queryMap["permissions"], unittest.equals(arg_permissions
)); | |
| 1473 | 1438 |
| 1474 | 1439 |
| 1475 var h = { | 1440 var h = { |
| 1476 "content-type" : "application/json; charset=utf-8", | 1441 "content-type" : "application/json; charset=utf-8", |
| 1477 }; | 1442 }; |
| 1478 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); | 1443 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
| 1479 return new async.Future.value(stringResponse(200, h, resp)); | 1444 return new async.Future.value(stringResponse(200, h, resp)); |
| 1480 }), true); | 1445 }), true); |
| 1481 res.testIamPermissions(arg_resource, permissions: arg_permissions).then(un
ittest.expectAsync(((api.TestIamPermissionsResponse response) { | 1446 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c(((api.TestIamPermissionsResponse response) { |
| 1482 checkTestIamPermissionsResponse(response); | 1447 checkTestIamPermissionsResponse(response); |
| 1483 }))); | 1448 }))); |
| 1484 }); | 1449 }); |
| 1485 | 1450 |
| 1486 unittest.test("method--update", () { | 1451 unittest.test("method--update", () { |
| 1487 | 1452 |
| 1488 var mock = new HttpServerMock(); | 1453 var mock = new HttpServerMock(); |
| 1489 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc
k).projects.configs.variables; | 1454 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc
k).projects.configs.variables; |
| 1490 var arg_request = buildVariable(); | 1455 var arg_request = buildVariable(); |
| 1491 var arg_name = "foo"; | 1456 var arg_name = "foo"; |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1724 res.get(arg_name).then(unittest.expectAsync(((api.Waiter response) { | 1689 res.get(arg_name).then(unittest.expectAsync(((api.Waiter response) { |
| 1725 checkWaiter(response); | 1690 checkWaiter(response); |
| 1726 }))); | 1691 }))); |
| 1727 }); | 1692 }); |
| 1728 | 1693 |
| 1729 unittest.test("method--list", () { | 1694 unittest.test("method--list", () { |
| 1730 | 1695 |
| 1731 var mock = new HttpServerMock(); | 1696 var mock = new HttpServerMock(); |
| 1732 api.ProjectsConfigsWaitersResourceApi res = new api.RuntimeconfigApi(mock)
.projects.configs.waiters; | 1697 api.ProjectsConfigsWaitersResourceApi res = new api.RuntimeconfigApi(mock)
.projects.configs.waiters; |
| 1733 var arg_parent = "foo"; | 1698 var arg_parent = "foo"; |
| 1699 var arg_pageToken = "foo"; |
| 1734 var arg_pageSize = 42; | 1700 var arg_pageSize = 42; |
| 1735 var arg_pageToken = "foo"; | |
| 1736 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1701 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1737 var path = (req.url).path; | 1702 var path = (req.url).path; |
| 1738 var pathOffset = 0; | 1703 var pathOffset = 0; |
| 1739 var index; | 1704 var index; |
| 1740 var subPart; | 1705 var subPart; |
| 1741 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1706 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1742 pathOffset += 1; | 1707 pathOffset += 1; |
| 1743 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 1708 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| 1744 pathOffset += 8; | 1709 pathOffset += 8; |
| 1745 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1710 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1746 | 1711 |
| 1747 var query = (req.url).query; | 1712 var query = (req.url).query; |
| 1748 var queryOffset = 0; | 1713 var queryOffset = 0; |
| 1749 var queryMap = {}; | 1714 var queryMap = {}; |
| 1750 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1715 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1751 parseBool(n) { | 1716 parseBool(n) { |
| 1752 if (n == "true") return true; | 1717 if (n == "true") return true; |
| 1753 if (n == "false") return false; | 1718 if (n == "false") return false; |
| 1754 if (n == null) return null; | 1719 if (n == null) return null; |
| 1755 throw new core.ArgumentError("Invalid boolean: $n"); | 1720 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1756 } | 1721 } |
| 1757 if (query.length > 0) { | 1722 if (query.length > 0) { |
| 1758 for (var part in query.split("&")) { | 1723 for (var part in query.split("&")) { |
| 1759 var keyvalue = part.split("="); | 1724 var keyvalue = part.split("="); |
| 1760 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1725 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1761 } | 1726 } |
| 1762 } | 1727 } |
| 1728 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1763 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1729 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1764 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 1765 | 1730 |
| 1766 | 1731 |
| 1767 var h = { | 1732 var h = { |
| 1768 "content-type" : "application/json; charset=utf-8", | 1733 "content-type" : "application/json; charset=utf-8", |
| 1769 }; | 1734 }; |
| 1770 var resp = convert.JSON.encode(buildListWaitersResponse()); | 1735 var resp = convert.JSON.encode(buildListWaitersResponse()); |
| 1771 return new async.Future.value(stringResponse(200, h, resp)); | 1736 return new async.Future.value(stringResponse(200, h, resp)); |
| 1772 }), true); | 1737 }), true); |
| 1773 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync(((api.ListWaitersResponse response) { | 1738 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync(((api.ListWaitersResponse response) { |
| 1774 checkListWaitersResponse(response); | 1739 checkListWaitersResponse(response); |
| 1775 }))); | 1740 }))); |
| 1776 }); | 1741 }); |
| 1777 | 1742 |
| 1778 unittest.test("method--testIamPermissions", () { | 1743 unittest.test("method--testIamPermissions", () { |
| 1779 | 1744 |
| 1780 var mock = new HttpServerMock(); | 1745 var mock = new HttpServerMock(); |
| 1781 api.ProjectsConfigsWaitersResourceApi res = new api.RuntimeconfigApi(mock)
.projects.configs.waiters; | 1746 api.ProjectsConfigsWaitersResourceApi res = new api.RuntimeconfigApi(mock)
.projects.configs.waiters; |
| 1747 var arg_request = buildTestIamPermissionsRequest(); |
| 1782 var arg_resource = "foo"; | 1748 var arg_resource = "foo"; |
| 1783 var arg_permissions = buildUnnamed3564(); | |
| 1784 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1749 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1750 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| 1751 checkTestIamPermissionsRequest(obj); |
| 1752 |
| 1785 var path = (req.url).path; | 1753 var path = (req.url).path; |
| 1786 var pathOffset = 0; | 1754 var pathOffset = 0; |
| 1787 var index; | 1755 var index; |
| 1788 var subPart; | 1756 var subPart; |
| 1789 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1757 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1790 pathOffset += 1; | 1758 pathOffset += 1; |
| 1791 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 1759 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| 1792 pathOffset += 8; | 1760 pathOffset += 8; |
| 1793 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1761 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1794 | 1762 |
| 1795 var query = (req.url).query; | 1763 var query = (req.url).query; |
| 1796 var queryOffset = 0; | 1764 var queryOffset = 0; |
| 1797 var queryMap = {}; | 1765 var queryMap = {}; |
| 1798 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1766 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1799 parseBool(n) { | 1767 parseBool(n) { |
| 1800 if (n == "true") return true; | 1768 if (n == "true") return true; |
| 1801 if (n == "false") return false; | 1769 if (n == "false") return false; |
| 1802 if (n == null) return null; | 1770 if (n == null) return null; |
| 1803 throw new core.ArgumentError("Invalid boolean: $n"); | 1771 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1804 } | 1772 } |
| 1805 if (query.length > 0) { | 1773 if (query.length > 0) { |
| 1806 for (var part in query.split("&")) { | 1774 for (var part in query.split("&")) { |
| 1807 var keyvalue = part.split("="); | 1775 var keyvalue = part.split("="); |
| 1808 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1776 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1809 } | 1777 } |
| 1810 } | 1778 } |
| 1811 unittest.expect(queryMap["permissions"], unittest.equals(arg_permissions
)); | |
| 1812 | 1779 |
| 1813 | 1780 |
| 1814 var h = { | 1781 var h = { |
| 1815 "content-type" : "application/json; charset=utf-8", | 1782 "content-type" : "application/json; charset=utf-8", |
| 1816 }; | 1783 }; |
| 1817 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); | 1784 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
| 1818 return new async.Future.value(stringResponse(200, h, resp)); | 1785 return new async.Future.value(stringResponse(200, h, resp)); |
| 1819 }), true); | 1786 }), true); |
| 1820 res.testIamPermissions(arg_resource, permissions: arg_permissions).then(un
ittest.expectAsync(((api.TestIamPermissionsResponse response) { | 1787 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c(((api.TestIamPermissionsResponse response) { |
| 1821 checkTestIamPermissionsResponse(response); | 1788 checkTestIamPermissionsResponse(response); |
| 1822 }))); | 1789 }))); |
| 1823 }); | 1790 }); |
| 1824 | 1791 |
| 1825 }); | 1792 }); |
| 1826 | 1793 |
| 1827 | 1794 |
| 1828 } | 1795 } |
| 1829 | 1796 |
| OLD | NEW |