OLD | NEW |
1 library googleapis.script.v1.test; | 1 library googleapis.script.v1.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
(...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 buildUnnamed910() { | 54 buildUnnamed935() { |
55 var o = new core.List<api.ScriptStackTraceElement>(); | 55 var o = new core.List<api.ScriptStackTraceElement>(); |
56 o.add(buildScriptStackTraceElement()); | 56 o.add(buildScriptStackTraceElement()); |
57 o.add(buildScriptStackTraceElement()); | 57 o.add(buildScriptStackTraceElement()); |
58 return o; | 58 return o; |
59 } | 59 } |
60 | 60 |
61 checkUnnamed910(core.List<api.ScriptStackTraceElement> o) { | 61 checkUnnamed935(core.List<api.ScriptStackTraceElement> o) { |
62 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
63 checkScriptStackTraceElement(o[0]); | 63 checkScriptStackTraceElement(o[0]); |
64 checkScriptStackTraceElement(o[1]); | 64 checkScriptStackTraceElement(o[1]); |
65 } | 65 } |
66 | 66 |
67 core.int buildCounterExecutionError = 0; | 67 core.int buildCounterExecutionError = 0; |
68 buildExecutionError() { | 68 buildExecutionError() { |
69 var o = new api.ExecutionError(); | 69 var o = new api.ExecutionError(); |
70 buildCounterExecutionError++; | 70 buildCounterExecutionError++; |
71 if (buildCounterExecutionError < 3) { | 71 if (buildCounterExecutionError < 3) { |
72 o.errorMessage = "foo"; | 72 o.errorMessage = "foo"; |
73 o.errorType = "foo"; | 73 o.errorType = "foo"; |
74 o.scriptStackTraceElements = buildUnnamed910(); | 74 o.scriptStackTraceElements = buildUnnamed935(); |
75 } | 75 } |
76 buildCounterExecutionError--; | 76 buildCounterExecutionError--; |
77 return o; | 77 return o; |
78 } | 78 } |
79 | 79 |
80 checkExecutionError(api.ExecutionError o) { | 80 checkExecutionError(api.ExecutionError o) { |
81 buildCounterExecutionError++; | 81 buildCounterExecutionError++; |
82 if (buildCounterExecutionError < 3) { | 82 if (buildCounterExecutionError < 3) { |
83 unittest.expect(o.errorMessage, unittest.equals('foo')); | 83 unittest.expect(o.errorMessage, unittest.equals('foo')); |
84 unittest.expect(o.errorType, unittest.equals('foo')); | 84 unittest.expect(o.errorType, unittest.equals('foo')); |
85 checkUnnamed910(o.scriptStackTraceElements); | 85 checkUnnamed935(o.scriptStackTraceElements); |
86 } | 86 } |
87 buildCounterExecutionError--; | 87 buildCounterExecutionError--; |
88 } | 88 } |
89 | 89 |
90 buildUnnamed911() { | 90 buildUnnamed936() { |
91 var o = new core.List<core.Object>(); | 91 var o = new core.List<core.Object>(); |
92 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 92 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
93 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 93 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
94 return o; | 94 return o; |
95 } | 95 } |
96 | 96 |
97 checkUnnamed911(core.List<core.Object> o) { | 97 checkUnnamed936(core.List<core.Object> o) { |
98 unittest.expect(o, unittest.hasLength(2)); | 98 unittest.expect(o, unittest.hasLength(2)); |
99 var casted1 = (o[0]) as core.Map; unittest.expect(casted1, unittest.hasLength(
3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], u
nittest.equals('foo')); | 99 var casted1 = (o[0]) as core.Map; unittest.expect(casted1, unittest.hasLength(
3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], u
nittest.equals('foo')); |
100 var casted2 = (o[1]) as core.Map; unittest.expect(casted2, unittest.hasLength(
3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], u
nittest.equals('foo')); | 100 var casted2 = (o[1]) as core.Map; unittest.expect(casted2, unittest.hasLength(
3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], u
nittest.equals('foo')); |
101 } | 101 } |
102 | 102 |
103 core.int buildCounterExecutionRequest = 0; | 103 core.int buildCounterExecutionRequest = 0; |
104 buildExecutionRequest() { | 104 buildExecutionRequest() { |
105 var o = new api.ExecutionRequest(); | 105 var o = new api.ExecutionRequest(); |
106 buildCounterExecutionRequest++; | 106 buildCounterExecutionRequest++; |
107 if (buildCounterExecutionRequest < 3) { | 107 if (buildCounterExecutionRequest < 3) { |
108 o.devMode = true; | 108 o.devMode = true; |
109 o.function = "foo"; | 109 o.function = "foo"; |
110 o.parameters = buildUnnamed911(); | 110 o.parameters = buildUnnamed936(); |
111 o.sessionState = "foo"; | 111 o.sessionState = "foo"; |
112 } | 112 } |
113 buildCounterExecutionRequest--; | 113 buildCounterExecutionRequest--; |
114 return o; | 114 return o; |
115 } | 115 } |
116 | 116 |
117 checkExecutionRequest(api.ExecutionRequest o) { | 117 checkExecutionRequest(api.ExecutionRequest o) { |
118 buildCounterExecutionRequest++; | 118 buildCounterExecutionRequest++; |
119 if (buildCounterExecutionRequest < 3) { | 119 if (buildCounterExecutionRequest < 3) { |
120 unittest.expect(o.devMode, unittest.isTrue); | 120 unittest.expect(o.devMode, unittest.isTrue); |
121 unittest.expect(o.function, unittest.equals('foo')); | 121 unittest.expect(o.function, unittest.equals('foo')); |
122 checkUnnamed911(o.parameters); | 122 checkUnnamed936(o.parameters); |
123 unittest.expect(o.sessionState, unittest.equals('foo')); | 123 unittest.expect(o.sessionState, unittest.equals('foo')); |
124 } | 124 } |
125 buildCounterExecutionRequest--; | 125 buildCounterExecutionRequest--; |
126 } | 126 } |
127 | 127 |
128 core.int buildCounterExecutionResponse = 0; | 128 core.int buildCounterExecutionResponse = 0; |
129 buildExecutionResponse() { | 129 buildExecutionResponse() { |
130 var o = new api.ExecutionResponse(); | 130 var o = new api.ExecutionResponse(); |
131 buildCounterExecutionResponse++; | 131 buildCounterExecutionResponse++; |
132 if (buildCounterExecutionResponse < 3) { | 132 if (buildCounterExecutionResponse < 3) { |
133 o.result = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 133 o.result = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
134 o.status = "foo"; | 134 o.status = "foo"; |
135 } | 135 } |
136 buildCounterExecutionResponse--; | 136 buildCounterExecutionResponse--; |
137 return o; | 137 return o; |
138 } | 138 } |
139 | 139 |
140 checkExecutionResponse(api.ExecutionResponse o) { | 140 checkExecutionResponse(api.ExecutionResponse o) { |
141 buildCounterExecutionResponse++; | 141 buildCounterExecutionResponse++; |
142 if (buildCounterExecutionResponse < 3) { | 142 if (buildCounterExecutionResponse < 3) { |
143 var casted3 = (o.result) as core.Map; unittest.expect(casted3, unittest.hasL
ength(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittes
t.expect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["strin
g"], unittest.equals('foo')); | 143 var casted3 = (o.result) as core.Map; unittest.expect(casted3, unittest.hasL
ength(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittes
t.expect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["strin
g"], unittest.equals('foo')); |
144 unittest.expect(o.status, unittest.equals('foo')); | 144 unittest.expect(o.status, unittest.equals('foo')); |
145 } | 145 } |
146 buildCounterExecutionResponse--; | 146 buildCounterExecutionResponse--; |
147 } | 147 } |
148 | 148 |
149 buildUnnamed912() { | 149 buildUnnamed937() { |
150 var o = new core.Map<core.String, core.Object>(); | 150 var o = new core.Map<core.String, core.Object>(); |
151 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 151 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
152 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 152 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
153 return o; | 153 return o; |
154 } | 154 } |
155 | 155 |
156 checkUnnamed912(core.Map<core.String, core.Object> o) { | 156 checkUnnamed937(core.Map<core.String, core.Object> o) { |
157 unittest.expect(o, unittest.hasLength(2)); | 157 unittest.expect(o, unittest.hasLength(2)); |
158 var casted4 = (o["x"]) 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')); | 158 var casted4 = (o["x"]) 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')); |
159 var casted5 = (o["y"]) 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')); | 159 var casted5 = (o["y"]) 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')); |
160 } | 160 } |
161 | 161 |
162 buildUnnamed913() { | 162 buildUnnamed938() { |
163 var o = new core.Map<core.String, core.Object>(); | 163 var o = new core.Map<core.String, core.Object>(); |
164 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 164 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
165 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 165 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
166 return o; | 166 return o; |
167 } | 167 } |
168 | 168 |
169 checkUnnamed913(core.Map<core.String, core.Object> o) { | 169 checkUnnamed938(core.Map<core.String, core.Object> o) { |
170 unittest.expect(o, unittest.hasLength(2)); | 170 unittest.expect(o, unittest.hasLength(2)); |
171 var casted6 = (o["x"]) 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')); | 171 var casted6 = (o["x"]) 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')); |
172 var casted7 = (o["y"]) as core.Map; unittest.expect(casted7, unittest.hasLengt
h(3)); unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted7["bool"], unittest.equals(true)); unittest.expect(casted7["string"],
unittest.equals('foo')); | 172 var casted7 = (o["y"]) as core.Map; unittest.expect(casted7, unittest.hasLengt
h(3)); unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted7["bool"], unittest.equals(true)); unittest.expect(casted7["string"],
unittest.equals('foo')); |
173 } | 173 } |
174 | 174 |
175 core.int buildCounterOperation = 0; | 175 core.int buildCounterOperation = 0; |
176 buildOperation() { | 176 buildOperation() { |
177 var o = new api.Operation(); | 177 var o = new api.Operation(); |
178 buildCounterOperation++; | 178 buildCounterOperation++; |
179 if (buildCounterOperation < 3) { | 179 if (buildCounterOperation < 3) { |
180 o.done = true; | 180 o.done = true; |
181 o.error = buildStatus(); | 181 o.error = buildStatus(); |
182 o.metadata = buildUnnamed912(); | 182 o.metadata = buildUnnamed937(); |
183 o.name = "foo"; | 183 o.name = "foo"; |
184 o.response = buildUnnamed913(); | 184 o.response = buildUnnamed938(); |
185 } | 185 } |
186 buildCounterOperation--; | 186 buildCounterOperation--; |
187 return o; | 187 return o; |
188 } | 188 } |
189 | 189 |
190 checkOperation(api.Operation o) { | 190 checkOperation(api.Operation o) { |
191 buildCounterOperation++; | 191 buildCounterOperation++; |
192 if (buildCounterOperation < 3) { | 192 if (buildCounterOperation < 3) { |
193 unittest.expect(o.done, unittest.isTrue); | 193 unittest.expect(o.done, unittest.isTrue); |
194 checkStatus(o.error); | 194 checkStatus(o.error); |
195 checkUnnamed912(o.metadata); | 195 checkUnnamed937(o.metadata); |
196 unittest.expect(o.name, unittest.equals('foo')); | 196 unittest.expect(o.name, unittest.equals('foo')); |
197 checkUnnamed913(o.response); | 197 checkUnnamed938(o.response); |
198 } | 198 } |
199 buildCounterOperation--; | 199 buildCounterOperation--; |
200 } | 200 } |
201 | 201 |
202 core.int buildCounterScriptStackTraceElement = 0; | 202 core.int buildCounterScriptStackTraceElement = 0; |
203 buildScriptStackTraceElement() { | 203 buildScriptStackTraceElement() { |
204 var o = new api.ScriptStackTraceElement(); | 204 var o = new api.ScriptStackTraceElement(); |
205 buildCounterScriptStackTraceElement++; | 205 buildCounterScriptStackTraceElement++; |
206 if (buildCounterScriptStackTraceElement < 3) { | 206 if (buildCounterScriptStackTraceElement < 3) { |
207 o.function = "foo"; | 207 o.function = "foo"; |
208 o.lineNumber = 42; | 208 o.lineNumber = 42; |
209 } | 209 } |
210 buildCounterScriptStackTraceElement--; | 210 buildCounterScriptStackTraceElement--; |
211 return o; | 211 return o; |
212 } | 212 } |
213 | 213 |
214 checkScriptStackTraceElement(api.ScriptStackTraceElement o) { | 214 checkScriptStackTraceElement(api.ScriptStackTraceElement o) { |
215 buildCounterScriptStackTraceElement++; | 215 buildCounterScriptStackTraceElement++; |
216 if (buildCounterScriptStackTraceElement < 3) { | 216 if (buildCounterScriptStackTraceElement < 3) { |
217 unittest.expect(o.function, unittest.equals('foo')); | 217 unittest.expect(o.function, unittest.equals('foo')); |
218 unittest.expect(o.lineNumber, unittest.equals(42)); | 218 unittest.expect(o.lineNumber, unittest.equals(42)); |
219 } | 219 } |
220 buildCounterScriptStackTraceElement--; | 220 buildCounterScriptStackTraceElement--; |
221 } | 221 } |
222 | 222 |
223 buildUnnamed914() { | 223 buildUnnamed939() { |
224 var o = new core.Map<core.String, core.Object>(); | 224 var o = new core.Map<core.String, core.Object>(); |
225 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 225 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
226 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 226 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
227 return o; | 227 return o; |
228 } | 228 } |
229 | 229 |
230 checkUnnamed914(core.Map<core.String, core.Object> o) { | 230 checkUnnamed939(core.Map<core.String, core.Object> o) { |
231 unittest.expect(o, unittest.hasLength(2)); | 231 unittest.expect(o, unittest.hasLength(2)); |
232 var casted8 = (o["x"]) as core.Map; unittest.expect(casted8, unittest.hasLengt
h(3)); unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted8["bool"], unittest.equals(true)); unittest.expect(casted8["string"],
unittest.equals('foo')); | 232 var casted8 = (o["x"]) as core.Map; unittest.expect(casted8, unittest.hasLengt
h(3)); unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted8["bool"], unittest.equals(true)); unittest.expect(casted8["string"],
unittest.equals('foo')); |
233 var casted9 = (o["y"]) as core.Map; unittest.expect(casted9, unittest.hasLengt
h(3)); unittest.expect(casted9["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted9["bool"], unittest.equals(true)); unittest.expect(casted9["string"],
unittest.equals('foo')); | 233 var casted9 = (o["y"]) as core.Map; unittest.expect(casted9, unittest.hasLengt
h(3)); unittest.expect(casted9["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted9["bool"], unittest.equals(true)); unittest.expect(casted9["string"],
unittest.equals('foo')); |
234 } | 234 } |
235 | 235 |
236 buildUnnamed915() { | 236 buildUnnamed940() { |
237 var o = new core.List<core.Map<core.String, core.Object>>(); | 237 var o = new core.List<core.Map<core.String, core.Object>>(); |
238 o.add(buildUnnamed914()); | 238 o.add(buildUnnamed939()); |
239 o.add(buildUnnamed914()); | 239 o.add(buildUnnamed939()); |
240 return o; | 240 return o; |
241 } | 241 } |
242 | 242 |
243 checkUnnamed915(core.List<core.Map<core.String, core.Object>> o) { | 243 checkUnnamed940(core.List<core.Map<core.String, core.Object>> o) { |
244 unittest.expect(o, unittest.hasLength(2)); | 244 unittest.expect(o, unittest.hasLength(2)); |
245 checkUnnamed914(o[0]); | 245 checkUnnamed939(o[0]); |
246 checkUnnamed914(o[1]); | 246 checkUnnamed939(o[1]); |
247 } | 247 } |
248 | 248 |
249 core.int buildCounterStatus = 0; | 249 core.int buildCounterStatus = 0; |
250 buildStatus() { | 250 buildStatus() { |
251 var o = new api.Status(); | 251 var o = new api.Status(); |
252 buildCounterStatus++; | 252 buildCounterStatus++; |
253 if (buildCounterStatus < 3) { | 253 if (buildCounterStatus < 3) { |
254 o.code = 42; | 254 o.code = 42; |
255 o.details = buildUnnamed915(); | 255 o.details = buildUnnamed940(); |
256 o.message = "foo"; | 256 o.message = "foo"; |
257 } | 257 } |
258 buildCounterStatus--; | 258 buildCounterStatus--; |
259 return o; | 259 return o; |
260 } | 260 } |
261 | 261 |
262 checkStatus(api.Status o) { | 262 checkStatus(api.Status o) { |
263 buildCounterStatus++; | 263 buildCounterStatus++; |
264 if (buildCounterStatus < 3) { | 264 if (buildCounterStatus < 3) { |
265 unittest.expect(o.code, unittest.equals(42)); | 265 unittest.expect(o.code, unittest.equals(42)); |
266 checkUnnamed915(o.details); | 266 checkUnnamed940(o.details); |
267 unittest.expect(o.message, unittest.equals('foo')); | 267 unittest.expect(o.message, unittest.equals('foo')); |
268 } | 268 } |
269 buildCounterStatus--; | 269 buildCounterStatus--; |
270 } | 270 } |
271 | 271 |
272 | 272 |
273 main() { | 273 main() { |
274 unittest.group("obj-schema-ExecutionError", () { | 274 unittest.group("obj-schema-ExecutionError", () { |
275 unittest.test("to-json--from-json", () { | 275 unittest.test("to-json--from-json", () { |
276 var o = buildExecutionError(); | 276 var o = buildExecutionError(); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 res.run(arg_request, arg_scriptId).then(unittest.expectAsync(((api.Operati
on response) { | 379 res.run(arg_request, arg_scriptId).then(unittest.expectAsync(((api.Operati
on response) { |
380 checkOperation(response); | 380 checkOperation(response); |
381 }))); | 381 }))); |
382 }); | 382 }); |
383 | 383 |
384 }); | 384 }); |
385 | 385 |
386 | 386 |
387 } | 387 } |
388 | 388 |
OLD | NEW |