OLD | NEW |
1 library googleapis.cloudbuild.v1.test; | 1 library googleapis.cloudbuild.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/cloudbuild/v1.dart' as api; | 12 import 'package:googleapis/cloudbuild/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 buildUnnamed1333() { | 54 buildUnnamed1340() { |
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 checkUnnamed1333(core.List<core.String> o) { | 61 checkUnnamed1340(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 buildUnnamed1334() { | 67 buildUnnamed1341() { |
68 var o = new core.List<api.BuildStep>(); | 68 var o = new core.List<api.BuildStep>(); |
69 o.add(buildBuildStep()); | 69 o.add(buildBuildStep()); |
70 o.add(buildBuildStep()); | 70 o.add(buildBuildStep()); |
71 return o; | 71 return o; |
72 } | 72 } |
73 | 73 |
74 checkUnnamed1334(core.List<api.BuildStep> o) { | 74 checkUnnamed1341(core.List<api.BuildStep> o) { |
75 unittest.expect(o, unittest.hasLength(2)); | 75 unittest.expect(o, unittest.hasLength(2)); |
76 checkBuildStep(o[0]); | 76 checkBuildStep(o[0]); |
77 checkBuildStep(o[1]); | 77 checkBuildStep(o[1]); |
78 } | 78 } |
79 | 79 |
80 buildUnnamed1335() { | 80 buildUnnamed1342() { |
81 var o = new core.Map<core.String, core.String>(); | 81 var o = new core.Map<core.String, core.String>(); |
82 o["x"] = "foo"; | 82 o["x"] = "foo"; |
83 o["y"] = "foo"; | 83 o["y"] = "foo"; |
84 return o; | 84 return o; |
85 } | 85 } |
86 | 86 |
87 checkUnnamed1335(core.Map<core.String, core.String> o) { | 87 checkUnnamed1342(core.Map<core.String, core.String> o) { |
88 unittest.expect(o, unittest.hasLength(2)); | 88 unittest.expect(o, unittest.hasLength(2)); |
89 unittest.expect(o["x"], unittest.equals('foo')); | 89 unittest.expect(o["x"], unittest.equals('foo')); |
90 unittest.expect(o["y"], unittest.equals('foo')); | 90 unittest.expect(o["y"], unittest.equals('foo')); |
91 } | 91 } |
92 | 92 |
93 buildUnnamed1336() { | 93 buildUnnamed1343() { |
94 var o = new core.List<core.String>(); | 94 var o = new core.List<core.String>(); |
95 o.add("foo"); | 95 o.add("foo"); |
96 o.add("foo"); | 96 o.add("foo"); |
97 return o; | 97 return o; |
98 } | 98 } |
99 | 99 |
100 checkUnnamed1336(core.List<core.String> o) { | 100 checkUnnamed1343(core.List<core.String> o) { |
101 unittest.expect(o, unittest.hasLength(2)); | 101 unittest.expect(o, unittest.hasLength(2)); |
102 unittest.expect(o[0], unittest.equals('foo')); | 102 unittest.expect(o[0], unittest.equals('foo')); |
103 unittest.expect(o[1], unittest.equals('foo')); | 103 unittest.expect(o[1], unittest.equals('foo')); |
104 } | 104 } |
105 | 105 |
106 core.int buildCounterBuild = 0; | 106 core.int buildCounterBuild = 0; |
107 buildBuild() { | 107 buildBuild() { |
108 var o = new api.Build(); | 108 var o = new api.Build(); |
109 buildCounterBuild++; | 109 buildCounterBuild++; |
110 if (buildCounterBuild < 3) { | 110 if (buildCounterBuild < 3) { |
111 o.buildTriggerId = "foo"; | 111 o.buildTriggerId = "foo"; |
112 o.createTime = "foo"; | 112 o.createTime = "foo"; |
113 o.finishTime = "foo"; | 113 o.finishTime = "foo"; |
114 o.id = "foo"; | 114 o.id = "foo"; |
115 o.images = buildUnnamed1333(); | 115 o.images = buildUnnamed1340(); |
116 o.logUrl = "foo"; | 116 o.logUrl = "foo"; |
117 o.logsBucket = "foo"; | 117 o.logsBucket = "foo"; |
118 o.options = buildBuildOptions(); | 118 o.options = buildBuildOptions(); |
119 o.projectId = "foo"; | 119 o.projectId = "foo"; |
120 o.results = buildResults(); | 120 o.results = buildResults(); |
121 o.source = buildSource(); | 121 o.source = buildSource(); |
122 o.sourceProvenance = buildSourceProvenance(); | 122 o.sourceProvenance = buildSourceProvenance(); |
123 o.startTime = "foo"; | 123 o.startTime = "foo"; |
124 o.status = "foo"; | 124 o.status = "foo"; |
125 o.statusDetail = "foo"; | 125 o.statusDetail = "foo"; |
126 o.steps = buildUnnamed1334(); | 126 o.steps = buildUnnamed1341(); |
127 o.substitutions = buildUnnamed1335(); | 127 o.substitutions = buildUnnamed1342(); |
128 o.tags = buildUnnamed1336(); | 128 o.tags = buildUnnamed1343(); |
129 o.timeout = "foo"; | 129 o.timeout = "foo"; |
130 } | 130 } |
131 buildCounterBuild--; | 131 buildCounterBuild--; |
132 return o; | 132 return o; |
133 } | 133 } |
134 | 134 |
135 checkBuild(api.Build o) { | 135 checkBuild(api.Build o) { |
136 buildCounterBuild++; | 136 buildCounterBuild++; |
137 if (buildCounterBuild < 3) { | 137 if (buildCounterBuild < 3) { |
138 unittest.expect(o.buildTriggerId, unittest.equals('foo')); | 138 unittest.expect(o.buildTriggerId, unittest.equals('foo')); |
139 unittest.expect(o.createTime, unittest.equals('foo')); | 139 unittest.expect(o.createTime, unittest.equals('foo')); |
140 unittest.expect(o.finishTime, unittest.equals('foo')); | 140 unittest.expect(o.finishTime, unittest.equals('foo')); |
141 unittest.expect(o.id, unittest.equals('foo')); | 141 unittest.expect(o.id, unittest.equals('foo')); |
142 checkUnnamed1333(o.images); | 142 checkUnnamed1340(o.images); |
143 unittest.expect(o.logUrl, unittest.equals('foo')); | 143 unittest.expect(o.logUrl, unittest.equals('foo')); |
144 unittest.expect(o.logsBucket, unittest.equals('foo')); | 144 unittest.expect(o.logsBucket, unittest.equals('foo')); |
145 checkBuildOptions(o.options); | 145 checkBuildOptions(o.options); |
146 unittest.expect(o.projectId, unittest.equals('foo')); | 146 unittest.expect(o.projectId, unittest.equals('foo')); |
147 checkResults(o.results); | 147 checkResults(o.results); |
148 checkSource(o.source); | 148 checkSource(o.source); |
149 checkSourceProvenance(o.sourceProvenance); | 149 checkSourceProvenance(o.sourceProvenance); |
150 unittest.expect(o.startTime, unittest.equals('foo')); | 150 unittest.expect(o.startTime, unittest.equals('foo')); |
151 unittest.expect(o.status, unittest.equals('foo')); | 151 unittest.expect(o.status, unittest.equals('foo')); |
152 unittest.expect(o.statusDetail, unittest.equals('foo')); | 152 unittest.expect(o.statusDetail, unittest.equals('foo')); |
153 checkUnnamed1334(o.steps); | 153 checkUnnamed1341(o.steps); |
154 checkUnnamed1335(o.substitutions); | 154 checkUnnamed1342(o.substitutions); |
155 checkUnnamed1336(o.tags); | 155 checkUnnamed1343(o.tags); |
156 unittest.expect(o.timeout, unittest.equals('foo')); | 156 unittest.expect(o.timeout, unittest.equals('foo')); |
157 } | 157 } |
158 buildCounterBuild--; | 158 buildCounterBuild--; |
159 } | 159 } |
160 | 160 |
161 core.int buildCounterBuildOperationMetadata = 0; | 161 core.int buildCounterBuildOperationMetadata = 0; |
162 buildBuildOperationMetadata() { | 162 buildBuildOperationMetadata() { |
163 var o = new api.BuildOperationMetadata(); | 163 var o = new api.BuildOperationMetadata(); |
164 buildCounterBuildOperationMetadata++; | 164 buildCounterBuildOperationMetadata++; |
165 if (buildCounterBuildOperationMetadata < 3) { | 165 if (buildCounterBuildOperationMetadata < 3) { |
166 o.build = buildBuild(); | 166 o.build = buildBuild(); |
167 } | 167 } |
168 buildCounterBuildOperationMetadata--; | 168 buildCounterBuildOperationMetadata--; |
169 return o; | 169 return o; |
170 } | 170 } |
171 | 171 |
172 checkBuildOperationMetadata(api.BuildOperationMetadata o) { | 172 checkBuildOperationMetadata(api.BuildOperationMetadata o) { |
173 buildCounterBuildOperationMetadata++; | 173 buildCounterBuildOperationMetadata++; |
174 if (buildCounterBuildOperationMetadata < 3) { | 174 if (buildCounterBuildOperationMetadata < 3) { |
175 checkBuild(o.build); | 175 checkBuild(o.build); |
176 } | 176 } |
177 buildCounterBuildOperationMetadata--; | 177 buildCounterBuildOperationMetadata--; |
178 } | 178 } |
179 | 179 |
180 buildUnnamed1337() { | 180 buildUnnamed1344() { |
181 var o = new core.List<core.String>(); | 181 var o = new core.List<core.String>(); |
182 o.add("foo"); | 182 o.add("foo"); |
183 o.add("foo"); | 183 o.add("foo"); |
184 return o; | 184 return o; |
185 } | 185 } |
186 | 186 |
187 checkUnnamed1337(core.List<core.String> o) { | 187 checkUnnamed1344(core.List<core.String> o) { |
188 unittest.expect(o, unittest.hasLength(2)); | 188 unittest.expect(o, unittest.hasLength(2)); |
189 unittest.expect(o[0], unittest.equals('foo')); | 189 unittest.expect(o[0], unittest.equals('foo')); |
190 unittest.expect(o[1], unittest.equals('foo')); | 190 unittest.expect(o[1], unittest.equals('foo')); |
191 } | 191 } |
192 | 192 |
193 core.int buildCounterBuildOptions = 0; | 193 core.int buildCounterBuildOptions = 0; |
194 buildBuildOptions() { | 194 buildBuildOptions() { |
195 var o = new api.BuildOptions(); | 195 var o = new api.BuildOptions(); |
196 buildCounterBuildOptions++; | 196 buildCounterBuildOptions++; |
197 if (buildCounterBuildOptions < 3) { | 197 if (buildCounterBuildOptions < 3) { |
198 o.requestedVerifyOption = "foo"; | 198 o.requestedVerifyOption = "foo"; |
199 o.sourceProvenanceHash = buildUnnamed1337(); | 199 o.sourceProvenanceHash = buildUnnamed1344(); |
200 } | 200 } |
201 buildCounterBuildOptions--; | 201 buildCounterBuildOptions--; |
202 return o; | 202 return o; |
203 } | 203 } |
204 | 204 |
205 checkBuildOptions(api.BuildOptions o) { | 205 checkBuildOptions(api.BuildOptions o) { |
206 buildCounterBuildOptions++; | 206 buildCounterBuildOptions++; |
207 if (buildCounterBuildOptions < 3) { | 207 if (buildCounterBuildOptions < 3) { |
208 unittest.expect(o.requestedVerifyOption, unittest.equals('foo')); | 208 unittest.expect(o.requestedVerifyOption, unittest.equals('foo')); |
209 checkUnnamed1337(o.sourceProvenanceHash); | 209 checkUnnamed1344(o.sourceProvenanceHash); |
210 } | 210 } |
211 buildCounterBuildOptions--; | 211 buildCounterBuildOptions--; |
212 } | 212 } |
213 | 213 |
214 buildUnnamed1338() { | 214 buildUnnamed1345() { |
215 var o = new core.List<core.String>(); | 215 var o = new core.List<core.String>(); |
216 o.add("foo"); | 216 o.add("foo"); |
217 o.add("foo"); | 217 o.add("foo"); |
218 return o; | 218 return o; |
219 } | 219 } |
220 | 220 |
221 checkUnnamed1338(core.List<core.String> o) { | 221 checkUnnamed1345(core.List<core.String> o) { |
222 unittest.expect(o, unittest.hasLength(2)); | 222 unittest.expect(o, unittest.hasLength(2)); |
223 unittest.expect(o[0], unittest.equals('foo')); | 223 unittest.expect(o[0], unittest.equals('foo')); |
224 unittest.expect(o[1], unittest.equals('foo')); | 224 unittest.expect(o[1], unittest.equals('foo')); |
225 } | 225 } |
226 | 226 |
227 buildUnnamed1339() { | 227 buildUnnamed1346() { |
228 var o = new core.List<core.String>(); | 228 var o = new core.List<core.String>(); |
229 o.add("foo"); | 229 o.add("foo"); |
230 o.add("foo"); | 230 o.add("foo"); |
231 return o; | 231 return o; |
232 } | 232 } |
233 | 233 |
234 checkUnnamed1339(core.List<core.String> o) { | 234 checkUnnamed1346(core.List<core.String> o) { |
235 unittest.expect(o, unittest.hasLength(2)); | 235 unittest.expect(o, unittest.hasLength(2)); |
236 unittest.expect(o[0], unittest.equals('foo')); | 236 unittest.expect(o[0], unittest.equals('foo')); |
237 unittest.expect(o[1], unittest.equals('foo')); | 237 unittest.expect(o[1], unittest.equals('foo')); |
238 } | 238 } |
239 | 239 |
240 buildUnnamed1340() { | 240 buildUnnamed1347() { |
241 var o = new core.List<core.String>(); | 241 var o = new core.List<core.String>(); |
242 o.add("foo"); | 242 o.add("foo"); |
243 o.add("foo"); | 243 o.add("foo"); |
244 return o; | 244 return o; |
245 } | 245 } |
246 | 246 |
247 checkUnnamed1340(core.List<core.String> o) { | 247 checkUnnamed1347(core.List<core.String> o) { |
248 unittest.expect(o, unittest.hasLength(2)); | 248 unittest.expect(o, unittest.hasLength(2)); |
249 unittest.expect(o[0], unittest.equals('foo')); | 249 unittest.expect(o[0], unittest.equals('foo')); |
250 unittest.expect(o[1], unittest.equals('foo')); | 250 unittest.expect(o[1], unittest.equals('foo')); |
251 } | 251 } |
252 | 252 |
253 core.int buildCounterBuildStep = 0; | 253 core.int buildCounterBuildStep = 0; |
254 buildBuildStep() { | 254 buildBuildStep() { |
255 var o = new api.BuildStep(); | 255 var o = new api.BuildStep(); |
256 buildCounterBuildStep++; | 256 buildCounterBuildStep++; |
257 if (buildCounterBuildStep < 3) { | 257 if (buildCounterBuildStep < 3) { |
258 o.args = buildUnnamed1338(); | 258 o.args = buildUnnamed1345(); |
259 o.dir = "foo"; | 259 o.dir = "foo"; |
260 o.entrypoint = "foo"; | 260 o.entrypoint = "foo"; |
261 o.env = buildUnnamed1339(); | 261 o.env = buildUnnamed1346(); |
262 o.id = "foo"; | 262 o.id = "foo"; |
263 o.name = "foo"; | 263 o.name = "foo"; |
264 o.waitFor = buildUnnamed1340(); | 264 o.waitFor = buildUnnamed1347(); |
265 } | 265 } |
266 buildCounterBuildStep--; | 266 buildCounterBuildStep--; |
267 return o; | 267 return o; |
268 } | 268 } |
269 | 269 |
270 checkBuildStep(api.BuildStep o) { | 270 checkBuildStep(api.BuildStep o) { |
271 buildCounterBuildStep++; | 271 buildCounterBuildStep++; |
272 if (buildCounterBuildStep < 3) { | 272 if (buildCounterBuildStep < 3) { |
273 checkUnnamed1338(o.args); | 273 checkUnnamed1345(o.args); |
274 unittest.expect(o.dir, unittest.equals('foo')); | 274 unittest.expect(o.dir, unittest.equals('foo')); |
275 unittest.expect(o.entrypoint, unittest.equals('foo')); | 275 unittest.expect(o.entrypoint, unittest.equals('foo')); |
276 checkUnnamed1339(o.env); | 276 checkUnnamed1346(o.env); |
277 unittest.expect(o.id, unittest.equals('foo')); | 277 unittest.expect(o.id, unittest.equals('foo')); |
278 unittest.expect(o.name, unittest.equals('foo')); | 278 unittest.expect(o.name, unittest.equals('foo')); |
279 checkUnnamed1340(o.waitFor); | 279 checkUnnamed1347(o.waitFor); |
280 } | 280 } |
281 buildCounterBuildStep--; | 281 buildCounterBuildStep--; |
282 } | 282 } |
283 | 283 |
284 buildUnnamed1341() { | 284 buildUnnamed1348() { |
285 var o = new core.Map<core.String, core.String>(); | 285 var o = new core.Map<core.String, core.String>(); |
286 o["x"] = "foo"; | 286 o["x"] = "foo"; |
287 o["y"] = "foo"; | 287 o["y"] = "foo"; |
288 return o; | 288 return o; |
289 } | 289 } |
290 | 290 |
291 checkUnnamed1341(core.Map<core.String, core.String> o) { | 291 checkUnnamed1348(core.Map<core.String, core.String> o) { |
292 unittest.expect(o, unittest.hasLength(2)); | 292 unittest.expect(o, unittest.hasLength(2)); |
293 unittest.expect(o["x"], unittest.equals('foo')); | 293 unittest.expect(o["x"], unittest.equals('foo')); |
294 unittest.expect(o["y"], unittest.equals('foo')); | 294 unittest.expect(o["y"], unittest.equals('foo')); |
295 } | 295 } |
296 | 296 |
297 core.int buildCounterBuildTrigger = 0; | 297 core.int buildCounterBuildTrigger = 0; |
298 buildBuildTrigger() { | 298 buildBuildTrigger() { |
299 var o = new api.BuildTrigger(); | 299 var o = new api.BuildTrigger(); |
300 buildCounterBuildTrigger++; | 300 buildCounterBuildTrigger++; |
301 if (buildCounterBuildTrigger < 3) { | 301 if (buildCounterBuildTrigger < 3) { |
302 o.build = buildBuild(); | 302 o.build = buildBuild(); |
303 o.createTime = "foo"; | 303 o.createTime = "foo"; |
304 o.description = "foo"; | 304 o.description = "foo"; |
305 o.disabled = true; | 305 o.disabled = true; |
306 o.filename = "foo"; | 306 o.filename = "foo"; |
307 o.id = "foo"; | 307 o.id = "foo"; |
308 o.substitutions = buildUnnamed1341(); | 308 o.substitutions = buildUnnamed1348(); |
309 o.triggerTemplate = buildRepoSource(); | 309 o.triggerTemplate = buildRepoSource(); |
310 } | 310 } |
311 buildCounterBuildTrigger--; | 311 buildCounterBuildTrigger--; |
312 return o; | 312 return o; |
313 } | 313 } |
314 | 314 |
315 checkBuildTrigger(api.BuildTrigger o) { | 315 checkBuildTrigger(api.BuildTrigger o) { |
316 buildCounterBuildTrigger++; | 316 buildCounterBuildTrigger++; |
317 if (buildCounterBuildTrigger < 3) { | 317 if (buildCounterBuildTrigger < 3) { |
318 checkBuild(o.build); | 318 checkBuild(o.build); |
319 unittest.expect(o.createTime, unittest.equals('foo')); | 319 unittest.expect(o.createTime, unittest.equals('foo')); |
320 unittest.expect(o.description, unittest.equals('foo')); | 320 unittest.expect(o.description, unittest.equals('foo')); |
321 unittest.expect(o.disabled, unittest.isTrue); | 321 unittest.expect(o.disabled, unittest.isTrue); |
322 unittest.expect(o.filename, unittest.equals('foo')); | 322 unittest.expect(o.filename, unittest.equals('foo')); |
323 unittest.expect(o.id, unittest.equals('foo')); | 323 unittest.expect(o.id, unittest.equals('foo')); |
324 checkUnnamed1341(o.substitutions); | 324 checkUnnamed1348(o.substitutions); |
325 checkRepoSource(o.triggerTemplate); | 325 checkRepoSource(o.triggerTemplate); |
326 } | 326 } |
327 buildCounterBuildTrigger--; | 327 buildCounterBuildTrigger--; |
328 } | 328 } |
329 | 329 |
330 core.int buildCounterBuiltImage = 0; | 330 core.int buildCounterBuiltImage = 0; |
331 buildBuiltImage() { | 331 buildBuiltImage() { |
332 var o = new api.BuiltImage(); | 332 var o = new api.BuiltImage(); |
333 buildCounterBuiltImage++; | 333 buildCounterBuiltImage++; |
334 if (buildCounterBuiltImage < 3) { | 334 if (buildCounterBuiltImage < 3) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 return o; | 392 return o; |
393 } | 393 } |
394 | 394 |
395 checkEmpty(api.Empty o) { | 395 checkEmpty(api.Empty o) { |
396 buildCounterEmpty++; | 396 buildCounterEmpty++; |
397 if (buildCounterEmpty < 3) { | 397 if (buildCounterEmpty < 3) { |
398 } | 398 } |
399 buildCounterEmpty--; | 399 buildCounterEmpty--; |
400 } | 400 } |
401 | 401 |
402 buildUnnamed1342() { | 402 buildUnnamed1349() { |
403 var o = new core.List<api.Hash>(); | 403 var o = new core.List<api.Hash>(); |
404 o.add(buildHash()); | 404 o.add(buildHash()); |
405 o.add(buildHash()); | 405 o.add(buildHash()); |
406 return o; | 406 return o; |
407 } | 407 } |
408 | 408 |
409 checkUnnamed1342(core.List<api.Hash> o) { | 409 checkUnnamed1349(core.List<api.Hash> o) { |
410 unittest.expect(o, unittest.hasLength(2)); | 410 unittest.expect(o, unittest.hasLength(2)); |
411 checkHash(o[0]); | 411 checkHash(o[0]); |
412 checkHash(o[1]); | 412 checkHash(o[1]); |
413 } | 413 } |
414 | 414 |
415 core.int buildCounterFileHashes = 0; | 415 core.int buildCounterFileHashes = 0; |
416 buildFileHashes() { | 416 buildFileHashes() { |
417 var o = new api.FileHashes(); | 417 var o = new api.FileHashes(); |
418 buildCounterFileHashes++; | 418 buildCounterFileHashes++; |
419 if (buildCounterFileHashes < 3) { | 419 if (buildCounterFileHashes < 3) { |
420 o.fileHash = buildUnnamed1342(); | 420 o.fileHash = buildUnnamed1349(); |
421 } | 421 } |
422 buildCounterFileHashes--; | 422 buildCounterFileHashes--; |
423 return o; | 423 return o; |
424 } | 424 } |
425 | 425 |
426 checkFileHashes(api.FileHashes o) { | 426 checkFileHashes(api.FileHashes o) { |
427 buildCounterFileHashes++; | 427 buildCounterFileHashes++; |
428 if (buildCounterFileHashes < 3) { | 428 if (buildCounterFileHashes < 3) { |
429 checkUnnamed1342(o.fileHash); | 429 checkUnnamed1349(o.fileHash); |
430 } | 430 } |
431 buildCounterFileHashes--; | 431 buildCounterFileHashes--; |
432 } | 432 } |
433 | 433 |
434 core.int buildCounterHash = 0; | 434 core.int buildCounterHash = 0; |
435 buildHash() { | 435 buildHash() { |
436 var o = new api.Hash(); | 436 var o = new api.Hash(); |
437 buildCounterHash++; | 437 buildCounterHash++; |
438 if (buildCounterHash < 3) { | 438 if (buildCounterHash < 3) { |
439 o.type = "foo"; | 439 o.type = "foo"; |
440 o.value = "foo"; | 440 o.value = "foo"; |
441 } | 441 } |
442 buildCounterHash--; | 442 buildCounterHash--; |
443 return o; | 443 return o; |
444 } | 444 } |
445 | 445 |
446 checkHash(api.Hash o) { | 446 checkHash(api.Hash o) { |
447 buildCounterHash++; | 447 buildCounterHash++; |
448 if (buildCounterHash < 3) { | 448 if (buildCounterHash < 3) { |
449 unittest.expect(o.type, unittest.equals('foo')); | 449 unittest.expect(o.type, unittest.equals('foo')); |
450 unittest.expect(o.value, unittest.equals('foo')); | 450 unittest.expect(o.value, unittest.equals('foo')); |
451 } | 451 } |
452 buildCounterHash--; | 452 buildCounterHash--; |
453 } | 453 } |
454 | 454 |
455 buildUnnamed1343() { | 455 buildUnnamed1350() { |
456 var o = new core.List<api.BuildTrigger>(); | 456 var o = new core.List<api.BuildTrigger>(); |
457 o.add(buildBuildTrigger()); | 457 o.add(buildBuildTrigger()); |
458 o.add(buildBuildTrigger()); | 458 o.add(buildBuildTrigger()); |
459 return o; | 459 return o; |
460 } | 460 } |
461 | 461 |
462 checkUnnamed1343(core.List<api.BuildTrigger> o) { | 462 checkUnnamed1350(core.List<api.BuildTrigger> o) { |
463 unittest.expect(o, unittest.hasLength(2)); | 463 unittest.expect(o, unittest.hasLength(2)); |
464 checkBuildTrigger(o[0]); | 464 checkBuildTrigger(o[0]); |
465 checkBuildTrigger(o[1]); | 465 checkBuildTrigger(o[1]); |
466 } | 466 } |
467 | 467 |
468 core.int buildCounterListBuildTriggersResponse = 0; | 468 core.int buildCounterListBuildTriggersResponse = 0; |
469 buildListBuildTriggersResponse() { | 469 buildListBuildTriggersResponse() { |
470 var o = new api.ListBuildTriggersResponse(); | 470 var o = new api.ListBuildTriggersResponse(); |
471 buildCounterListBuildTriggersResponse++; | 471 buildCounterListBuildTriggersResponse++; |
472 if (buildCounterListBuildTriggersResponse < 3) { | 472 if (buildCounterListBuildTriggersResponse < 3) { |
473 o.triggers = buildUnnamed1343(); | 473 o.triggers = buildUnnamed1350(); |
474 } | 474 } |
475 buildCounterListBuildTriggersResponse--; | 475 buildCounterListBuildTriggersResponse--; |
476 return o; | 476 return o; |
477 } | 477 } |
478 | 478 |
479 checkListBuildTriggersResponse(api.ListBuildTriggersResponse o) { | 479 checkListBuildTriggersResponse(api.ListBuildTriggersResponse o) { |
480 buildCounterListBuildTriggersResponse++; | 480 buildCounterListBuildTriggersResponse++; |
481 if (buildCounterListBuildTriggersResponse < 3) { | 481 if (buildCounterListBuildTriggersResponse < 3) { |
482 checkUnnamed1343(o.triggers); | 482 checkUnnamed1350(o.triggers); |
483 } | 483 } |
484 buildCounterListBuildTriggersResponse--; | 484 buildCounterListBuildTriggersResponse--; |
485 } | 485 } |
486 | 486 |
487 buildUnnamed1344() { | 487 buildUnnamed1351() { |
488 var o = new core.List<api.Build>(); | 488 var o = new core.List<api.Build>(); |
489 o.add(buildBuild()); | 489 o.add(buildBuild()); |
490 o.add(buildBuild()); | 490 o.add(buildBuild()); |
491 return o; | 491 return o; |
492 } | 492 } |
493 | 493 |
494 checkUnnamed1344(core.List<api.Build> o) { | 494 checkUnnamed1351(core.List<api.Build> o) { |
495 unittest.expect(o, unittest.hasLength(2)); | 495 unittest.expect(o, unittest.hasLength(2)); |
496 checkBuild(o[0]); | 496 checkBuild(o[0]); |
497 checkBuild(o[1]); | 497 checkBuild(o[1]); |
498 } | 498 } |
499 | 499 |
500 core.int buildCounterListBuildsResponse = 0; | 500 core.int buildCounterListBuildsResponse = 0; |
501 buildListBuildsResponse() { | 501 buildListBuildsResponse() { |
502 var o = new api.ListBuildsResponse(); | 502 var o = new api.ListBuildsResponse(); |
503 buildCounterListBuildsResponse++; | 503 buildCounterListBuildsResponse++; |
504 if (buildCounterListBuildsResponse < 3) { | 504 if (buildCounterListBuildsResponse < 3) { |
505 o.builds = buildUnnamed1344(); | 505 o.builds = buildUnnamed1351(); |
506 o.nextPageToken = "foo"; | 506 o.nextPageToken = "foo"; |
507 } | 507 } |
508 buildCounterListBuildsResponse--; | 508 buildCounterListBuildsResponse--; |
509 return o; | 509 return o; |
510 } | 510 } |
511 | 511 |
512 checkListBuildsResponse(api.ListBuildsResponse o) { | 512 checkListBuildsResponse(api.ListBuildsResponse o) { |
513 buildCounterListBuildsResponse++; | 513 buildCounterListBuildsResponse++; |
514 if (buildCounterListBuildsResponse < 3) { | 514 if (buildCounterListBuildsResponse < 3) { |
515 checkUnnamed1344(o.builds); | 515 checkUnnamed1351(o.builds); |
516 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 516 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
517 } | 517 } |
518 buildCounterListBuildsResponse--; | 518 buildCounterListBuildsResponse--; |
519 } | 519 } |
520 | 520 |
521 buildUnnamed1345() { | 521 buildUnnamed1352() { |
522 var o = new core.List<api.Operation>(); | 522 var o = new core.List<api.Operation>(); |
523 o.add(buildOperation()); | 523 o.add(buildOperation()); |
524 o.add(buildOperation()); | 524 o.add(buildOperation()); |
525 return o; | 525 return o; |
526 } | 526 } |
527 | 527 |
528 checkUnnamed1345(core.List<api.Operation> o) { | 528 checkUnnamed1352(core.List<api.Operation> o) { |
529 unittest.expect(o, unittest.hasLength(2)); | 529 unittest.expect(o, unittest.hasLength(2)); |
530 checkOperation(o[0]); | 530 checkOperation(o[0]); |
531 checkOperation(o[1]); | 531 checkOperation(o[1]); |
532 } | 532 } |
533 | 533 |
534 core.int buildCounterListOperationsResponse = 0; | 534 core.int buildCounterListOperationsResponse = 0; |
535 buildListOperationsResponse() { | 535 buildListOperationsResponse() { |
536 var o = new api.ListOperationsResponse(); | 536 var o = new api.ListOperationsResponse(); |
537 buildCounterListOperationsResponse++; | 537 buildCounterListOperationsResponse++; |
538 if (buildCounterListOperationsResponse < 3) { | 538 if (buildCounterListOperationsResponse < 3) { |
539 o.nextPageToken = "foo"; | 539 o.nextPageToken = "foo"; |
540 o.operations = buildUnnamed1345(); | 540 o.operations = buildUnnamed1352(); |
541 } | 541 } |
542 buildCounterListOperationsResponse--; | 542 buildCounterListOperationsResponse--; |
543 return o; | 543 return o; |
544 } | 544 } |
545 | 545 |
546 checkListOperationsResponse(api.ListOperationsResponse o) { | 546 checkListOperationsResponse(api.ListOperationsResponse o) { |
547 buildCounterListOperationsResponse++; | 547 buildCounterListOperationsResponse++; |
548 if (buildCounterListOperationsResponse < 3) { | 548 if (buildCounterListOperationsResponse < 3) { |
549 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 549 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
550 checkUnnamed1345(o.operations); | 550 checkUnnamed1352(o.operations); |
551 } | 551 } |
552 buildCounterListOperationsResponse--; | 552 buildCounterListOperationsResponse--; |
553 } | 553 } |
554 | 554 |
555 buildUnnamed1346() { | 555 buildUnnamed1353() { |
556 var o = new core.Map<core.String, core.Object>(); | 556 var o = new core.Map<core.String, core.Object>(); |
557 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 557 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
558 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 558 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
559 return o; | 559 return o; |
560 } | 560 } |
561 | 561 |
562 checkUnnamed1346(core.Map<core.String, core.Object> o) { | 562 checkUnnamed1353(core.Map<core.String, core.Object> o) { |
563 unittest.expect(o, unittest.hasLength(2)); | 563 unittest.expect(o, unittest.hasLength(2)); |
564 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')); | 564 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')); |
565 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')); | 565 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')); |
566 } | 566 } |
567 | 567 |
568 buildUnnamed1347() { | 568 buildUnnamed1354() { |
569 var o = new core.Map<core.String, core.Object>(); | 569 var o = new core.Map<core.String, core.Object>(); |
570 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 570 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
571 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 571 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
572 return o; | 572 return o; |
573 } | 573 } |
574 | 574 |
575 checkUnnamed1347(core.Map<core.String, core.Object> o) { | 575 checkUnnamed1354(core.Map<core.String, core.Object> o) { |
576 unittest.expect(o, unittest.hasLength(2)); | 576 unittest.expect(o, unittest.hasLength(2)); |
577 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')); | 577 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')); |
578 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')); | 578 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')); |
579 } | 579 } |
580 | 580 |
581 core.int buildCounterOperation = 0; | 581 core.int buildCounterOperation = 0; |
582 buildOperation() { | 582 buildOperation() { |
583 var o = new api.Operation(); | 583 var o = new api.Operation(); |
584 buildCounterOperation++; | 584 buildCounterOperation++; |
585 if (buildCounterOperation < 3) { | 585 if (buildCounterOperation < 3) { |
586 o.done = true; | 586 o.done = true; |
587 o.error = buildStatus(); | 587 o.error = buildStatus(); |
588 o.metadata = buildUnnamed1346(); | 588 o.metadata = buildUnnamed1353(); |
589 o.name = "foo"; | 589 o.name = "foo"; |
590 o.response = buildUnnamed1347(); | 590 o.response = buildUnnamed1354(); |
591 } | 591 } |
592 buildCounterOperation--; | 592 buildCounterOperation--; |
593 return o; | 593 return o; |
594 } | 594 } |
595 | 595 |
596 checkOperation(api.Operation o) { | 596 checkOperation(api.Operation o) { |
597 buildCounterOperation++; | 597 buildCounterOperation++; |
598 if (buildCounterOperation < 3) { | 598 if (buildCounterOperation < 3) { |
599 unittest.expect(o.done, unittest.isTrue); | 599 unittest.expect(o.done, unittest.isTrue); |
600 checkStatus(o.error); | 600 checkStatus(o.error); |
601 checkUnnamed1346(o.metadata); | 601 checkUnnamed1353(o.metadata); |
602 unittest.expect(o.name, unittest.equals('foo')); | 602 unittest.expect(o.name, unittest.equals('foo')); |
603 checkUnnamed1347(o.response); | 603 checkUnnamed1354(o.response); |
604 } | 604 } |
605 buildCounterOperation--; | 605 buildCounterOperation--; |
606 } | 606 } |
607 | 607 |
608 core.int buildCounterRepoSource = 0; | 608 core.int buildCounterRepoSource = 0; |
609 buildRepoSource() { | 609 buildRepoSource() { |
610 var o = new api.RepoSource(); | 610 var o = new api.RepoSource(); |
611 buildCounterRepoSource++; | 611 buildCounterRepoSource++; |
612 if (buildCounterRepoSource < 3) { | 612 if (buildCounterRepoSource < 3) { |
613 o.branchName = "foo"; | 613 o.branchName = "foo"; |
(...skipping 11 matching lines...) Expand all Loading... |
625 if (buildCounterRepoSource < 3) { | 625 if (buildCounterRepoSource < 3) { |
626 unittest.expect(o.branchName, unittest.equals('foo')); | 626 unittest.expect(o.branchName, unittest.equals('foo')); |
627 unittest.expect(o.commitSha, unittest.equals('foo')); | 627 unittest.expect(o.commitSha, unittest.equals('foo')); |
628 unittest.expect(o.projectId, unittest.equals('foo')); | 628 unittest.expect(o.projectId, unittest.equals('foo')); |
629 unittest.expect(o.repoName, unittest.equals('foo')); | 629 unittest.expect(o.repoName, unittest.equals('foo')); |
630 unittest.expect(o.tagName, unittest.equals('foo')); | 630 unittest.expect(o.tagName, unittest.equals('foo')); |
631 } | 631 } |
632 buildCounterRepoSource--; | 632 buildCounterRepoSource--; |
633 } | 633 } |
634 | 634 |
635 buildUnnamed1348() { | 635 buildUnnamed1355() { |
636 var o = new core.List<core.String>(); | 636 var o = new core.List<core.String>(); |
637 o.add("foo"); | 637 o.add("foo"); |
638 o.add("foo"); | 638 o.add("foo"); |
639 return o; | 639 return o; |
640 } | 640 } |
641 | 641 |
642 checkUnnamed1348(core.List<core.String> o) { | 642 checkUnnamed1355(core.List<core.String> o) { |
643 unittest.expect(o, unittest.hasLength(2)); | 643 unittest.expect(o, unittest.hasLength(2)); |
644 unittest.expect(o[0], unittest.equals('foo')); | 644 unittest.expect(o[0], unittest.equals('foo')); |
645 unittest.expect(o[1], unittest.equals('foo')); | 645 unittest.expect(o[1], unittest.equals('foo')); |
646 } | 646 } |
647 | 647 |
648 buildUnnamed1349() { | 648 buildUnnamed1356() { |
649 var o = new core.List<api.BuiltImage>(); | 649 var o = new core.List<api.BuiltImage>(); |
650 o.add(buildBuiltImage()); | 650 o.add(buildBuiltImage()); |
651 o.add(buildBuiltImage()); | 651 o.add(buildBuiltImage()); |
652 return o; | 652 return o; |
653 } | 653 } |
654 | 654 |
655 checkUnnamed1349(core.List<api.BuiltImage> o) { | 655 checkUnnamed1356(core.List<api.BuiltImage> o) { |
656 unittest.expect(o, unittest.hasLength(2)); | 656 unittest.expect(o, unittest.hasLength(2)); |
657 checkBuiltImage(o[0]); | 657 checkBuiltImage(o[0]); |
658 checkBuiltImage(o[1]); | 658 checkBuiltImage(o[1]); |
659 } | 659 } |
660 | 660 |
661 core.int buildCounterResults = 0; | 661 core.int buildCounterResults = 0; |
662 buildResults() { | 662 buildResults() { |
663 var o = new api.Results(); | 663 var o = new api.Results(); |
664 buildCounterResults++; | 664 buildCounterResults++; |
665 if (buildCounterResults < 3) { | 665 if (buildCounterResults < 3) { |
666 o.buildStepImages = buildUnnamed1348(); | 666 o.buildStepImages = buildUnnamed1355(); |
667 o.images = buildUnnamed1349(); | 667 o.images = buildUnnamed1356(); |
668 } | 668 } |
669 buildCounterResults--; | 669 buildCounterResults--; |
670 return o; | 670 return o; |
671 } | 671 } |
672 | 672 |
673 checkResults(api.Results o) { | 673 checkResults(api.Results o) { |
674 buildCounterResults++; | 674 buildCounterResults++; |
675 if (buildCounterResults < 3) { | 675 if (buildCounterResults < 3) { |
676 checkUnnamed1348(o.buildStepImages); | 676 checkUnnamed1355(o.buildStepImages); |
677 checkUnnamed1349(o.images); | 677 checkUnnamed1356(o.images); |
678 } | 678 } |
679 buildCounterResults--; | 679 buildCounterResults--; |
680 } | 680 } |
681 | 681 |
682 core.int buildCounterSource = 0; | 682 core.int buildCounterSource = 0; |
683 buildSource() { | 683 buildSource() { |
684 var o = new api.Source(); | 684 var o = new api.Source(); |
685 buildCounterSource++; | 685 buildCounterSource++; |
686 if (buildCounterSource < 3) { | 686 if (buildCounterSource < 3) { |
687 o.repoSource = buildRepoSource(); | 687 o.repoSource = buildRepoSource(); |
688 o.storageSource = buildStorageSource(); | 688 o.storageSource = buildStorageSource(); |
689 } | 689 } |
690 buildCounterSource--; | 690 buildCounterSource--; |
691 return o; | 691 return o; |
692 } | 692 } |
693 | 693 |
694 checkSource(api.Source o) { | 694 checkSource(api.Source o) { |
695 buildCounterSource++; | 695 buildCounterSource++; |
696 if (buildCounterSource < 3) { | 696 if (buildCounterSource < 3) { |
697 checkRepoSource(o.repoSource); | 697 checkRepoSource(o.repoSource); |
698 checkStorageSource(o.storageSource); | 698 checkStorageSource(o.storageSource); |
699 } | 699 } |
700 buildCounterSource--; | 700 buildCounterSource--; |
701 } | 701 } |
702 | 702 |
703 buildUnnamed1350() { | 703 buildUnnamed1357() { |
704 var o = new core.Map<core.String, api.FileHashes>(); | 704 var o = new core.Map<core.String, api.FileHashes>(); |
705 o["x"] = buildFileHashes(); | 705 o["x"] = buildFileHashes(); |
706 o["y"] = buildFileHashes(); | 706 o["y"] = buildFileHashes(); |
707 return o; | 707 return o; |
708 } | 708 } |
709 | 709 |
710 checkUnnamed1350(core.Map<core.String, api.FileHashes> o) { | 710 checkUnnamed1357(core.Map<core.String, api.FileHashes> o) { |
711 unittest.expect(o, unittest.hasLength(2)); | 711 unittest.expect(o, unittest.hasLength(2)); |
712 checkFileHashes(o["x"]); | 712 checkFileHashes(o["x"]); |
713 checkFileHashes(o["y"]); | 713 checkFileHashes(o["y"]); |
714 } | 714 } |
715 | 715 |
716 core.int buildCounterSourceProvenance = 0; | 716 core.int buildCounterSourceProvenance = 0; |
717 buildSourceProvenance() { | 717 buildSourceProvenance() { |
718 var o = new api.SourceProvenance(); | 718 var o = new api.SourceProvenance(); |
719 buildCounterSourceProvenance++; | 719 buildCounterSourceProvenance++; |
720 if (buildCounterSourceProvenance < 3) { | 720 if (buildCounterSourceProvenance < 3) { |
721 o.fileHashes = buildUnnamed1350(); | 721 o.fileHashes = buildUnnamed1357(); |
722 o.resolvedRepoSource = buildRepoSource(); | 722 o.resolvedRepoSource = buildRepoSource(); |
723 o.resolvedStorageSource = buildStorageSource(); | 723 o.resolvedStorageSource = buildStorageSource(); |
724 } | 724 } |
725 buildCounterSourceProvenance--; | 725 buildCounterSourceProvenance--; |
726 return o; | 726 return o; |
727 } | 727 } |
728 | 728 |
729 checkSourceProvenance(api.SourceProvenance o) { | 729 checkSourceProvenance(api.SourceProvenance o) { |
730 buildCounterSourceProvenance++; | 730 buildCounterSourceProvenance++; |
731 if (buildCounterSourceProvenance < 3) { | 731 if (buildCounterSourceProvenance < 3) { |
732 checkUnnamed1350(o.fileHashes); | 732 checkUnnamed1357(o.fileHashes); |
733 checkRepoSource(o.resolvedRepoSource); | 733 checkRepoSource(o.resolvedRepoSource); |
734 checkStorageSource(o.resolvedStorageSource); | 734 checkStorageSource(o.resolvedStorageSource); |
735 } | 735 } |
736 buildCounterSourceProvenance--; | 736 buildCounterSourceProvenance--; |
737 } | 737 } |
738 | 738 |
739 buildUnnamed1351() { | 739 buildUnnamed1358() { |
740 var o = new core.Map<core.String, core.Object>(); | 740 var o = new core.Map<core.String, core.Object>(); |
741 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 741 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
742 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 742 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
743 return o; | 743 return o; |
744 } | 744 } |
745 | 745 |
746 checkUnnamed1351(core.Map<core.String, core.Object> o) { | 746 checkUnnamed1358(core.Map<core.String, core.Object> o) { |
747 unittest.expect(o, unittest.hasLength(2)); | 747 unittest.expect(o, unittest.hasLength(2)); |
748 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')); | 748 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')); |
749 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')); | 749 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')); |
750 } | 750 } |
751 | 751 |
752 buildUnnamed1352() { | 752 buildUnnamed1359() { |
753 var o = new core.List<core.Map<core.String, core.Object>>(); | 753 var o = new core.List<core.Map<core.String, core.Object>>(); |
754 o.add(buildUnnamed1351()); | 754 o.add(buildUnnamed1358()); |
755 o.add(buildUnnamed1351()); | 755 o.add(buildUnnamed1358()); |
756 return o; | 756 return o; |
757 } | 757 } |
758 | 758 |
759 checkUnnamed1352(core.List<core.Map<core.String, core.Object>> o) { | 759 checkUnnamed1359(core.List<core.Map<core.String, core.Object>> o) { |
760 unittest.expect(o, unittest.hasLength(2)); | 760 unittest.expect(o, unittest.hasLength(2)); |
761 checkUnnamed1351(o[0]); | 761 checkUnnamed1358(o[0]); |
762 checkUnnamed1351(o[1]); | 762 checkUnnamed1358(o[1]); |
763 } | 763 } |
764 | 764 |
765 core.int buildCounterStatus = 0; | 765 core.int buildCounterStatus = 0; |
766 buildStatus() { | 766 buildStatus() { |
767 var o = new api.Status(); | 767 var o = new api.Status(); |
768 buildCounterStatus++; | 768 buildCounterStatus++; |
769 if (buildCounterStatus < 3) { | 769 if (buildCounterStatus < 3) { |
770 o.code = 42; | 770 o.code = 42; |
771 o.details = buildUnnamed1352(); | 771 o.details = buildUnnamed1359(); |
772 o.message = "foo"; | 772 o.message = "foo"; |
773 } | 773 } |
774 buildCounterStatus--; | 774 buildCounterStatus--; |
775 return o; | 775 return o; |
776 } | 776 } |
777 | 777 |
778 checkStatus(api.Status o) { | 778 checkStatus(api.Status o) { |
779 buildCounterStatus++; | 779 buildCounterStatus++; |
780 if (buildCounterStatus < 3) { | 780 if (buildCounterStatus < 3) { |
781 unittest.expect(o.code, unittest.equals(42)); | 781 unittest.expect(o.code, unittest.equals(42)); |
782 checkUnnamed1352(o.details); | 782 checkUnnamed1359(o.details); |
783 unittest.expect(o.message, unittest.equals('foo')); | 783 unittest.expect(o.message, unittest.equals('foo')); |
784 } | 784 } |
785 buildCounterStatus--; | 785 buildCounterStatus--; |
786 } | 786 } |
787 | 787 |
788 core.int buildCounterStorageSource = 0; | 788 core.int buildCounterStorageSource = 0; |
789 buildStorageSource() { | 789 buildStorageSource() { |
790 var o = new api.StorageSource(); | 790 var o = new api.StorageSource(); |
791 buildCounterStorageSource++; | 791 buildCounterStorageSource++; |
792 if (buildCounterStorageSource < 3) { | 792 if (buildCounterStorageSource < 3) { |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 }); | 999 }); |
1000 | 1000 |
1001 | 1001 |
1002 unittest.group("resource-OperationsResourceApi", () { | 1002 unittest.group("resource-OperationsResourceApi", () { |
1003 unittest.test("method--cancel", () { | 1003 unittest.test("method--cancel", () { |
1004 | 1004 |
1005 var mock = new HttpServerMock(); | 1005 var mock = new HttpServerMock(); |
1006 api.OperationsResourceApi res = new api.CloudbuildApi(mock).operations; | 1006 api.OperationsResourceApi res = new api.CloudbuildApi(mock).operations; |
1007 var arg_request = buildCancelOperationRequest(); | 1007 var arg_request = buildCancelOperationRequest(); |
1008 var arg_name = "foo"; | 1008 var arg_name = "foo"; |
1009 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1009 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1010 var obj = new api.CancelOperationRequest.fromJson(json); | 1010 var obj = new api.CancelOperationRequest.fromJson(json); |
1011 checkCancelOperationRequest(obj); | 1011 checkCancelOperationRequest(obj); |
1012 | 1012 |
1013 var path = (req.url).path; | 1013 var path = (req.url).path; |
1014 var pathOffset = 0; | 1014 var pathOffset = 0; |
1015 var index; | 1015 var index; |
1016 var subPart; | 1016 var subPart; |
1017 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1017 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1018 pathOffset += 1; | 1018 pathOffset += 1; |
1019 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1019 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1037 } | 1037 } |
1038 } | 1038 } |
1039 | 1039 |
1040 | 1040 |
1041 var h = { | 1041 var h = { |
1042 "content-type" : "application/json; charset=utf-8", | 1042 "content-type" : "application/json; charset=utf-8", |
1043 }; | 1043 }; |
1044 var resp = convert.JSON.encode(buildEmpty()); | 1044 var resp = convert.JSON.encode(buildEmpty()); |
1045 return new async.Future.value(stringResponse(200, h, resp)); | 1045 return new async.Future.value(stringResponse(200, h, resp)); |
1046 }), true); | 1046 }), true); |
1047 res.cancel(arg_request, arg_name).then(unittest.expectAsync(((api.Empty re
sponse) { | 1047 res.cancel(arg_request, arg_name).then(unittest.expectAsync1(((api.Empty r
esponse) { |
1048 checkEmpty(response); | 1048 checkEmpty(response); |
1049 }))); | 1049 }))); |
1050 }); | 1050 }); |
1051 | 1051 |
1052 unittest.test("method--get", () { | 1052 unittest.test("method--get", () { |
1053 | 1053 |
1054 var mock = new HttpServerMock(); | 1054 var mock = new HttpServerMock(); |
1055 api.OperationsResourceApi res = new api.CloudbuildApi(mock).operations; | 1055 api.OperationsResourceApi res = new api.CloudbuildApi(mock).operations; |
1056 var arg_name = "foo"; | 1056 var arg_name = "foo"; |
1057 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1057 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1058 var path = (req.url).path; | 1058 var path = (req.url).path; |
1059 var pathOffset = 0; | 1059 var pathOffset = 0; |
1060 var index; | 1060 var index; |
1061 var subPart; | 1061 var subPart; |
1062 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1062 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1063 pathOffset += 1; | 1063 pathOffset += 1; |
1064 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1064 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
1065 pathOffset += 3; | 1065 pathOffset += 3; |
1066 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1066 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1067 | 1067 |
(...skipping 14 matching lines...) Expand all Loading... |
1082 } | 1082 } |
1083 } | 1083 } |
1084 | 1084 |
1085 | 1085 |
1086 var h = { | 1086 var h = { |
1087 "content-type" : "application/json; charset=utf-8", | 1087 "content-type" : "application/json; charset=utf-8", |
1088 }; | 1088 }; |
1089 var resp = convert.JSON.encode(buildOperation()); | 1089 var resp = convert.JSON.encode(buildOperation()); |
1090 return new async.Future.value(stringResponse(200, h, resp)); | 1090 return new async.Future.value(stringResponse(200, h, resp)); |
1091 }), true); | 1091 }), true); |
1092 res.get(arg_name).then(unittest.expectAsync(((api.Operation response) { | 1092 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) { |
1093 checkOperation(response); | 1093 checkOperation(response); |
1094 }))); | 1094 }))); |
1095 }); | 1095 }); |
1096 | 1096 |
1097 unittest.test("method--list", () { | 1097 unittest.test("method--list", () { |
1098 | 1098 |
1099 var mock = new HttpServerMock(); | 1099 var mock = new HttpServerMock(); |
1100 api.OperationsResourceApi res = new api.CloudbuildApi(mock).operations; | 1100 api.OperationsResourceApi res = new api.CloudbuildApi(mock).operations; |
1101 var arg_name = "foo"; | 1101 var arg_name = "foo"; |
| 1102 var arg_filter = "foo"; |
1102 var arg_pageToken = "foo"; | 1103 var arg_pageToken = "foo"; |
1103 var arg_pageSize = 42; | 1104 var arg_pageSize = 42; |
1104 var arg_filter = "foo"; | 1105 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1105 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1106 var path = (req.url).path; | 1106 var path = (req.url).path; |
1107 var pathOffset = 0; | 1107 var pathOffset = 0; |
1108 var index; | 1108 var index; |
1109 var subPart; | 1109 var subPart; |
1110 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1110 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1111 pathOffset += 1; | 1111 pathOffset += 1; |
1112 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1112 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
1113 pathOffset += 3; | 1113 pathOffset += 3; |
1114 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1114 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1115 | 1115 |
1116 var query = (req.url).query; | 1116 var query = (req.url).query; |
1117 var queryOffset = 0; | 1117 var queryOffset = 0; |
1118 var queryMap = {}; | 1118 var queryMap = {}; |
1119 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1119 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1120 parseBool(n) { | 1120 parseBool(n) { |
1121 if (n == "true") return true; | 1121 if (n == "true") return true; |
1122 if (n == "false") return false; | 1122 if (n == "false") return false; |
1123 if (n == null) return null; | 1123 if (n == null) return null; |
1124 throw new core.ArgumentError("Invalid boolean: $n"); | 1124 throw new core.ArgumentError("Invalid boolean: $n"); |
1125 } | 1125 } |
1126 if (query.length > 0) { | 1126 if (query.length > 0) { |
1127 for (var part in query.split("&")) { | 1127 for (var part in query.split("&")) { |
1128 var keyvalue = part.split("="); | 1128 var keyvalue = part.split("="); |
1129 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1129 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1130 } | 1130 } |
1131 } | 1131 } |
| 1132 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
1132 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1133 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1133 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1134 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1134 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | |
1135 | 1135 |
1136 | 1136 |
1137 var h = { | 1137 var h = { |
1138 "content-type" : "application/json; charset=utf-8", | 1138 "content-type" : "application/json; charset=utf-8", |
1139 }; | 1139 }; |
1140 var resp = convert.JSON.encode(buildListOperationsResponse()); | 1140 var resp = convert.JSON.encode(buildListOperationsResponse()); |
1141 return new async.Future.value(stringResponse(200, h, resp)); | 1141 return new async.Future.value(stringResponse(200, h, resp)); |
1142 }), true); | 1142 }), true); |
1143 res.list(arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize, filte
r: arg_filter).then(unittest.expectAsync(((api.ListOperationsResponse response)
{ | 1143 res.list(arg_name, filter: arg_filter, pageToken: arg_pageToken, pageSize:
arg_pageSize).then(unittest.expectAsync1(((api.ListOperationsResponse response)
{ |
1144 checkListOperationsResponse(response); | 1144 checkListOperationsResponse(response); |
1145 }))); | 1145 }))); |
1146 }); | 1146 }); |
1147 | 1147 |
1148 }); | 1148 }); |
1149 | 1149 |
1150 | 1150 |
1151 unittest.group("resource-ProjectsBuildsResourceApi", () { | 1151 unittest.group("resource-ProjectsBuildsResourceApi", () { |
1152 unittest.test("method--cancel", () { | 1152 unittest.test("method--cancel", () { |
1153 | 1153 |
1154 var mock = new HttpServerMock(); | 1154 var mock = new HttpServerMock(); |
1155 api.ProjectsBuildsResourceApi res = new api.CloudbuildApi(mock).projects.b
uilds; | 1155 api.ProjectsBuildsResourceApi res = new api.CloudbuildApi(mock).projects.b
uilds; |
1156 var arg_request = buildCancelBuildRequest(); | 1156 var arg_request = buildCancelBuildRequest(); |
1157 var arg_projectId = "foo"; | 1157 var arg_projectId = "foo"; |
1158 var arg_id = "foo"; | 1158 var arg_id = "foo"; |
1159 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1159 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1160 var obj = new api.CancelBuildRequest.fromJson(json); | 1160 var obj = new api.CancelBuildRequest.fromJson(json); |
1161 checkCancelBuildRequest(obj); | 1161 checkCancelBuildRequest(obj); |
1162 | 1162 |
1163 var path = (req.url).path; | 1163 var path = (req.url).path; |
1164 var pathOffset = 0; | 1164 var pathOffset = 0; |
1165 var index; | 1165 var index; |
1166 var subPart; | 1166 var subPart; |
1167 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1167 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1168 pathOffset += 1; | 1168 pathOffset += 1; |
1169 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 1169 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); |
(...skipping 30 matching lines...) Expand all Loading... |
1200 } | 1200 } |
1201 } | 1201 } |
1202 | 1202 |
1203 | 1203 |
1204 var h = { | 1204 var h = { |
1205 "content-type" : "application/json; charset=utf-8", | 1205 "content-type" : "application/json; charset=utf-8", |
1206 }; | 1206 }; |
1207 var resp = convert.JSON.encode(buildBuild()); | 1207 var resp = convert.JSON.encode(buildBuild()); |
1208 return new async.Future.value(stringResponse(200, h, resp)); | 1208 return new async.Future.value(stringResponse(200, h, resp)); |
1209 }), true); | 1209 }), true); |
1210 res.cancel(arg_request, arg_projectId, arg_id).then(unittest.expectAsync((
(api.Build response) { | 1210 res.cancel(arg_request, arg_projectId, arg_id).then(unittest.expectAsync1(
((api.Build response) { |
1211 checkBuild(response); | 1211 checkBuild(response); |
1212 }))); | 1212 }))); |
1213 }); | 1213 }); |
1214 | 1214 |
1215 unittest.test("method--create", () { | 1215 unittest.test("method--create", () { |
1216 | 1216 |
1217 var mock = new HttpServerMock(); | 1217 var mock = new HttpServerMock(); |
1218 api.ProjectsBuildsResourceApi res = new api.CloudbuildApi(mock).projects.b
uilds; | 1218 api.ProjectsBuildsResourceApi res = new api.CloudbuildApi(mock).projects.b
uilds; |
1219 var arg_request = buildBuild(); | 1219 var arg_request = buildBuild(); |
1220 var arg_projectId = "foo"; | 1220 var arg_projectId = "foo"; |
1221 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1221 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1222 var obj = new api.Build.fromJson(json); | 1222 var obj = new api.Build.fromJson(json); |
1223 checkBuild(obj); | 1223 checkBuild(obj); |
1224 | 1224 |
1225 var path = (req.url).path; | 1225 var path = (req.url).path; |
1226 var pathOffset = 0; | 1226 var pathOffset = 0; |
1227 var index; | 1227 var index; |
1228 var subPart; | 1228 var subPart; |
1229 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1229 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1230 pathOffset += 1; | 1230 pathOffset += 1; |
1231 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 1231 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); |
(...skipping 23 matching lines...) Expand all Loading... |
1255 } | 1255 } |
1256 } | 1256 } |
1257 | 1257 |
1258 | 1258 |
1259 var h = { | 1259 var h = { |
1260 "content-type" : "application/json; charset=utf-8", | 1260 "content-type" : "application/json; charset=utf-8", |
1261 }; | 1261 }; |
1262 var resp = convert.JSON.encode(buildOperation()); | 1262 var resp = convert.JSON.encode(buildOperation()); |
1263 return new async.Future.value(stringResponse(200, h, resp)); | 1263 return new async.Future.value(stringResponse(200, h, resp)); |
1264 }), true); | 1264 }), true); |
1265 res.create(arg_request, arg_projectId).then(unittest.expectAsync(((api.Ope
ration response) { | 1265 res.create(arg_request, arg_projectId).then(unittest.expectAsync1(((api.Op
eration response) { |
1266 checkOperation(response); | 1266 checkOperation(response); |
1267 }))); | 1267 }))); |
1268 }); | 1268 }); |
1269 | 1269 |
1270 unittest.test("method--get", () { | 1270 unittest.test("method--get", () { |
1271 | 1271 |
1272 var mock = new HttpServerMock(); | 1272 var mock = new HttpServerMock(); |
1273 api.ProjectsBuildsResourceApi res = new api.CloudbuildApi(mock).projects.b
uilds; | 1273 api.ProjectsBuildsResourceApi res = new api.CloudbuildApi(mock).projects.b
uilds; |
1274 var arg_projectId = "foo"; | 1274 var arg_projectId = "foo"; |
1275 var arg_id = "foo"; | 1275 var arg_id = "foo"; |
1276 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1276 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1277 var path = (req.url).path; | 1277 var path = (req.url).path; |
1278 var pathOffset = 0; | 1278 var pathOffset = 0; |
1279 var index; | 1279 var index; |
1280 var subPart; | 1280 var subPart; |
1281 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1281 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1282 pathOffset += 1; | 1282 pathOffset += 1; |
1283 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 1283 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); |
1284 pathOffset += 12; | 1284 pathOffset += 12; |
1285 index = path.indexOf("/builds/", pathOffset); | 1285 index = path.indexOf("/builds/", pathOffset); |
1286 unittest.expect(index >= 0, unittest.isTrue); | 1286 unittest.expect(index >= 0, unittest.isTrue); |
(...skipping 23 matching lines...) Expand all Loading... |
1310 } | 1310 } |
1311 } | 1311 } |
1312 | 1312 |
1313 | 1313 |
1314 var h = { | 1314 var h = { |
1315 "content-type" : "application/json; charset=utf-8", | 1315 "content-type" : "application/json; charset=utf-8", |
1316 }; | 1316 }; |
1317 var resp = convert.JSON.encode(buildBuild()); | 1317 var resp = convert.JSON.encode(buildBuild()); |
1318 return new async.Future.value(stringResponse(200, h, resp)); | 1318 return new async.Future.value(stringResponse(200, h, resp)); |
1319 }), true); | 1319 }), true); |
1320 res.get(arg_projectId, arg_id).then(unittest.expectAsync(((api.Build respo
nse) { | 1320 res.get(arg_projectId, arg_id).then(unittest.expectAsync1(((api.Build resp
onse) { |
1321 checkBuild(response); | 1321 checkBuild(response); |
1322 }))); | 1322 }))); |
1323 }); | 1323 }); |
1324 | 1324 |
1325 unittest.test("method--list", () { | 1325 unittest.test("method--list", () { |
1326 | 1326 |
1327 var mock = new HttpServerMock(); | 1327 var mock = new HttpServerMock(); |
1328 api.ProjectsBuildsResourceApi res = new api.CloudbuildApi(mock).projects.b
uilds; | 1328 api.ProjectsBuildsResourceApi res = new api.CloudbuildApi(mock).projects.b
uilds; |
1329 var arg_projectId = "foo"; | 1329 var arg_projectId = "foo"; |
1330 var arg_filter = "foo"; | 1330 var arg_filter = "foo"; |
1331 var arg_pageToken = "foo"; | 1331 var arg_pageToken = "foo"; |
1332 var arg_pageSize = 42; | 1332 var arg_pageSize = 42; |
1333 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1333 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1334 var path = (req.url).path; | 1334 var path = (req.url).path; |
1335 var pathOffset = 0; | 1335 var pathOffset = 0; |
1336 var index; | 1336 var index; |
1337 var subPart; | 1337 var subPart; |
1338 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1338 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1339 pathOffset += 1; | 1339 pathOffset += 1; |
1340 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 1340 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); |
1341 pathOffset += 12; | 1341 pathOffset += 12; |
1342 index = path.indexOf("/builds", pathOffset); | 1342 index = path.indexOf("/builds", pathOffset); |
1343 unittest.expect(index >= 0, unittest.isTrue); | 1343 unittest.expect(index >= 0, unittest.isTrue); |
(...skipping 23 matching lines...) Expand all Loading... |
1367 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1367 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1368 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1368 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1369 | 1369 |
1370 | 1370 |
1371 var h = { | 1371 var h = { |
1372 "content-type" : "application/json; charset=utf-8", | 1372 "content-type" : "application/json; charset=utf-8", |
1373 }; | 1373 }; |
1374 var resp = convert.JSON.encode(buildListBuildsResponse()); | 1374 var resp = convert.JSON.encode(buildListBuildsResponse()); |
1375 return new async.Future.value(stringResponse(200, h, resp)); | 1375 return new async.Future.value(stringResponse(200, h, resp)); |
1376 }), true); | 1376 }), true); |
1377 res.list(arg_projectId, filter: arg_filter, pageToken: arg_pageToken, page
Size: arg_pageSize).then(unittest.expectAsync(((api.ListBuildsResponse response)
{ | 1377 res.list(arg_projectId, filter: arg_filter, pageToken: arg_pageToken, page
Size: arg_pageSize).then(unittest.expectAsync1(((api.ListBuildsResponse response
) { |
1378 checkListBuildsResponse(response); | 1378 checkListBuildsResponse(response); |
1379 }))); | 1379 }))); |
1380 }); | 1380 }); |
1381 | 1381 |
1382 }); | 1382 }); |
1383 | 1383 |
1384 | 1384 |
1385 unittest.group("resource-ProjectsTriggersResourceApi", () { | 1385 unittest.group("resource-ProjectsTriggersResourceApi", () { |
1386 unittest.test("method--create", () { | 1386 unittest.test("method--create", () { |
1387 | 1387 |
1388 var mock = new HttpServerMock(); | 1388 var mock = new HttpServerMock(); |
1389 api.ProjectsTriggersResourceApi res = new api.CloudbuildApi(mock).projects
.triggers; | 1389 api.ProjectsTriggersResourceApi res = new api.CloudbuildApi(mock).projects
.triggers; |
1390 var arg_request = buildBuildTrigger(); | 1390 var arg_request = buildBuildTrigger(); |
1391 var arg_projectId = "foo"; | 1391 var arg_projectId = "foo"; |
1392 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1392 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1393 var obj = new api.BuildTrigger.fromJson(json); | 1393 var obj = new api.BuildTrigger.fromJson(json); |
1394 checkBuildTrigger(obj); | 1394 checkBuildTrigger(obj); |
1395 | 1395 |
1396 var path = (req.url).path; | 1396 var path = (req.url).path; |
1397 var pathOffset = 0; | 1397 var pathOffset = 0; |
1398 var index; | 1398 var index; |
1399 var subPart; | 1399 var subPart; |
1400 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1400 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1401 pathOffset += 1; | 1401 pathOffset += 1; |
1402 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 1402 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); |
(...skipping 23 matching lines...) Expand all Loading... |
1426 } | 1426 } |
1427 } | 1427 } |
1428 | 1428 |
1429 | 1429 |
1430 var h = { | 1430 var h = { |
1431 "content-type" : "application/json; charset=utf-8", | 1431 "content-type" : "application/json; charset=utf-8", |
1432 }; | 1432 }; |
1433 var resp = convert.JSON.encode(buildBuildTrigger()); | 1433 var resp = convert.JSON.encode(buildBuildTrigger()); |
1434 return new async.Future.value(stringResponse(200, h, resp)); | 1434 return new async.Future.value(stringResponse(200, h, resp)); |
1435 }), true); | 1435 }), true); |
1436 res.create(arg_request, arg_projectId).then(unittest.expectAsync(((api.Bui
ldTrigger response) { | 1436 res.create(arg_request, arg_projectId).then(unittest.expectAsync1(((api.Bu
ildTrigger response) { |
1437 checkBuildTrigger(response); | 1437 checkBuildTrigger(response); |
1438 }))); | 1438 }))); |
1439 }); | 1439 }); |
1440 | 1440 |
1441 unittest.test("method--delete", () { | 1441 unittest.test("method--delete", () { |
1442 | 1442 |
1443 var mock = new HttpServerMock(); | 1443 var mock = new HttpServerMock(); |
1444 api.ProjectsTriggersResourceApi res = new api.CloudbuildApi(mock).projects
.triggers; | 1444 api.ProjectsTriggersResourceApi res = new api.CloudbuildApi(mock).projects
.triggers; |
1445 var arg_projectId = "foo"; | 1445 var arg_projectId = "foo"; |
1446 var arg_triggerId = "foo"; | 1446 var arg_triggerId = "foo"; |
1447 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1447 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1448 var path = (req.url).path; | 1448 var path = (req.url).path; |
1449 var pathOffset = 0; | 1449 var pathOffset = 0; |
1450 var index; | 1450 var index; |
1451 var subPart; | 1451 var subPart; |
1452 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1452 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1453 pathOffset += 1; | 1453 pathOffset += 1; |
1454 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 1454 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); |
1455 pathOffset += 12; | 1455 pathOffset += 12; |
1456 index = path.indexOf("/triggers/", pathOffset); | 1456 index = path.indexOf("/triggers/", pathOffset); |
1457 unittest.expect(index >= 0, unittest.isTrue); | 1457 unittest.expect(index >= 0, unittest.isTrue); |
(...skipping 23 matching lines...) Expand all Loading... |
1481 } | 1481 } |
1482 } | 1482 } |
1483 | 1483 |
1484 | 1484 |
1485 var h = { | 1485 var h = { |
1486 "content-type" : "application/json; charset=utf-8", | 1486 "content-type" : "application/json; charset=utf-8", |
1487 }; | 1487 }; |
1488 var resp = convert.JSON.encode(buildEmpty()); | 1488 var resp = convert.JSON.encode(buildEmpty()); |
1489 return new async.Future.value(stringResponse(200, h, resp)); | 1489 return new async.Future.value(stringResponse(200, h, resp)); |
1490 }), true); | 1490 }), true); |
1491 res.delete(arg_projectId, arg_triggerId).then(unittest.expectAsync(((api.E
mpty response) { | 1491 res.delete(arg_projectId, arg_triggerId).then(unittest.expectAsync1(((api.
Empty response) { |
1492 checkEmpty(response); | 1492 checkEmpty(response); |
1493 }))); | 1493 }))); |
1494 }); | 1494 }); |
1495 | 1495 |
1496 unittest.test("method--get", () { | 1496 unittest.test("method--get", () { |
1497 | 1497 |
1498 var mock = new HttpServerMock(); | 1498 var mock = new HttpServerMock(); |
1499 api.ProjectsTriggersResourceApi res = new api.CloudbuildApi(mock).projects
.triggers; | 1499 api.ProjectsTriggersResourceApi res = new api.CloudbuildApi(mock).projects
.triggers; |
1500 var arg_projectId = "foo"; | 1500 var arg_projectId = "foo"; |
1501 var arg_triggerId = "foo"; | 1501 var arg_triggerId = "foo"; |
1502 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1502 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1503 var path = (req.url).path; | 1503 var path = (req.url).path; |
1504 var pathOffset = 0; | 1504 var pathOffset = 0; |
1505 var index; | 1505 var index; |
1506 var subPart; | 1506 var subPart; |
1507 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1507 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1508 pathOffset += 1; | 1508 pathOffset += 1; |
1509 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 1509 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); |
1510 pathOffset += 12; | 1510 pathOffset += 12; |
1511 index = path.indexOf("/triggers/", pathOffset); | 1511 index = path.indexOf("/triggers/", pathOffset); |
1512 unittest.expect(index >= 0, unittest.isTrue); | 1512 unittest.expect(index >= 0, unittest.isTrue); |
(...skipping 23 matching lines...) Expand all Loading... |
1536 } | 1536 } |
1537 } | 1537 } |
1538 | 1538 |
1539 | 1539 |
1540 var h = { | 1540 var h = { |
1541 "content-type" : "application/json; charset=utf-8", | 1541 "content-type" : "application/json; charset=utf-8", |
1542 }; | 1542 }; |
1543 var resp = convert.JSON.encode(buildBuildTrigger()); | 1543 var resp = convert.JSON.encode(buildBuildTrigger()); |
1544 return new async.Future.value(stringResponse(200, h, resp)); | 1544 return new async.Future.value(stringResponse(200, h, resp)); |
1545 }), true); | 1545 }), true); |
1546 res.get(arg_projectId, arg_triggerId).then(unittest.expectAsync(((api.Buil
dTrigger response) { | 1546 res.get(arg_projectId, arg_triggerId).then(unittest.expectAsync1(((api.Bui
ldTrigger response) { |
1547 checkBuildTrigger(response); | 1547 checkBuildTrigger(response); |
1548 }))); | 1548 }))); |
1549 }); | 1549 }); |
1550 | 1550 |
1551 unittest.test("method--list", () { | 1551 unittest.test("method--list", () { |
1552 | 1552 |
1553 var mock = new HttpServerMock(); | 1553 var mock = new HttpServerMock(); |
1554 api.ProjectsTriggersResourceApi res = new api.CloudbuildApi(mock).projects
.triggers; | 1554 api.ProjectsTriggersResourceApi res = new api.CloudbuildApi(mock).projects
.triggers; |
1555 var arg_projectId = "foo"; | 1555 var arg_projectId = "foo"; |
1556 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1556 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1557 var path = (req.url).path; | 1557 var path = (req.url).path; |
1558 var pathOffset = 0; | 1558 var pathOffset = 0; |
1559 var index; | 1559 var index; |
1560 var subPart; | 1560 var subPart; |
1561 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1561 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1562 pathOffset += 1; | 1562 pathOffset += 1; |
1563 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 1563 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); |
1564 pathOffset += 12; | 1564 pathOffset += 12; |
1565 index = path.indexOf("/triggers", pathOffset); | 1565 index = path.indexOf("/triggers", pathOffset); |
1566 unittest.expect(index >= 0, unittest.isTrue); | 1566 unittest.expect(index >= 0, unittest.isTrue); |
(...skipping 20 matching lines...) Expand all Loading... |
1587 } | 1587 } |
1588 } | 1588 } |
1589 | 1589 |
1590 | 1590 |
1591 var h = { | 1591 var h = { |
1592 "content-type" : "application/json; charset=utf-8", | 1592 "content-type" : "application/json; charset=utf-8", |
1593 }; | 1593 }; |
1594 var resp = convert.JSON.encode(buildListBuildTriggersResponse()); | 1594 var resp = convert.JSON.encode(buildListBuildTriggersResponse()); |
1595 return new async.Future.value(stringResponse(200, h, resp)); | 1595 return new async.Future.value(stringResponse(200, h, resp)); |
1596 }), true); | 1596 }), true); |
1597 res.list(arg_projectId).then(unittest.expectAsync(((api.ListBuildTriggersR
esponse response) { | 1597 res.list(arg_projectId).then(unittest.expectAsync1(((api.ListBuildTriggers
Response response) { |
1598 checkListBuildTriggersResponse(response); | 1598 checkListBuildTriggersResponse(response); |
1599 }))); | 1599 }))); |
1600 }); | 1600 }); |
1601 | 1601 |
1602 unittest.test("method--patch", () { | 1602 unittest.test("method--patch", () { |
1603 | 1603 |
1604 var mock = new HttpServerMock(); | 1604 var mock = new HttpServerMock(); |
1605 api.ProjectsTriggersResourceApi res = new api.CloudbuildApi(mock).projects
.triggers; | 1605 api.ProjectsTriggersResourceApi res = new api.CloudbuildApi(mock).projects
.triggers; |
1606 var arg_request = buildBuildTrigger(); | 1606 var arg_request = buildBuildTrigger(); |
1607 var arg_projectId = "foo"; | 1607 var arg_projectId = "foo"; |
1608 var arg_triggerId = "foo"; | 1608 var arg_triggerId = "foo"; |
1609 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1609 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1610 var obj = new api.BuildTrigger.fromJson(json); | 1610 var obj = new api.BuildTrigger.fromJson(json); |
1611 checkBuildTrigger(obj); | 1611 checkBuildTrigger(obj); |
1612 | 1612 |
1613 var path = (req.url).path; | 1613 var path = (req.url).path; |
1614 var pathOffset = 0; | 1614 var pathOffset = 0; |
1615 var index; | 1615 var index; |
1616 var subPart; | 1616 var subPart; |
1617 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1617 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1618 pathOffset += 1; | 1618 pathOffset += 1; |
1619 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 1619 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); |
(...skipping 26 matching lines...) Expand all Loading... |
1646 } | 1646 } |
1647 } | 1647 } |
1648 | 1648 |
1649 | 1649 |
1650 var h = { | 1650 var h = { |
1651 "content-type" : "application/json; charset=utf-8", | 1651 "content-type" : "application/json; charset=utf-8", |
1652 }; | 1652 }; |
1653 var resp = convert.JSON.encode(buildBuildTrigger()); | 1653 var resp = convert.JSON.encode(buildBuildTrigger()); |
1654 return new async.Future.value(stringResponse(200, h, resp)); | 1654 return new async.Future.value(stringResponse(200, h, resp)); |
1655 }), true); | 1655 }), true); |
1656 res.patch(arg_request, arg_projectId, arg_triggerId).then(unittest.expectA
sync(((api.BuildTrigger response) { | 1656 res.patch(arg_request, arg_projectId, arg_triggerId).then(unittest.expectA
sync1(((api.BuildTrigger response) { |
1657 checkBuildTrigger(response); | 1657 checkBuildTrigger(response); |
1658 }))); | 1658 }))); |
1659 }); | 1659 }); |
1660 | 1660 |
1661 }); | 1661 }); |
1662 | 1662 |
1663 | 1663 |
1664 } | 1664 } |
1665 | 1665 |
OLD | NEW |