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 buildUnnamed682() { | 54 buildUnnamed702() { |
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 checkUnnamed682(core.List<api.ScriptStackTraceElement> o) { | 61 checkUnnamed702(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 = buildUnnamed682(); | 74 o.scriptStackTraceElements = buildUnnamed702(); |
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 checkUnnamed682(o.scriptStackTraceElements); | 85 checkUnnamed702(o.scriptStackTraceElements); |
86 } | 86 } |
87 buildCounterExecutionError--; | 87 buildCounterExecutionError--; |
88 } | 88 } |
89 | 89 |
90 buildUnnamed683() { | 90 buildUnnamed703() { |
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 checkUnnamed683(core.List<core.Object> o) { | 97 checkUnnamed703(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 = buildUnnamed683(); | 110 o.parameters = buildUnnamed703(); |
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 checkUnnamed683(o.parameters); | 122 checkUnnamed703(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 } | 134 } |
135 buildCounterExecutionResponse--; | 135 buildCounterExecutionResponse--; |
136 return o; | 136 return o; |
137 } | 137 } |
138 | 138 |
139 checkExecutionResponse(api.ExecutionResponse o) { | 139 checkExecutionResponse(api.ExecutionResponse o) { |
140 buildCounterExecutionResponse++; | 140 buildCounterExecutionResponse++; |
141 if (buildCounterExecutionResponse < 3) { | 141 if (buildCounterExecutionResponse < 3) { |
142 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')); | 142 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 } | 143 } |
144 buildCounterExecutionResponse--; | 144 buildCounterExecutionResponse--; |
145 } | 145 } |
146 | 146 |
147 buildUnnamed684() { | 147 buildUnnamed704() { |
148 var o = new core.Map<core.String, core.Object>(); | 148 var o = new core.Map<core.String, core.Object>(); |
149 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 149 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
150 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 150 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
151 return o; | 151 return o; |
152 } | 152 } |
153 | 153 |
154 checkUnnamed684(core.Map<core.String, core.Object> o) { | 154 checkUnnamed704(core.Map<core.String, core.Object> o) { |
155 unittest.expect(o, unittest.hasLength(2)); | 155 unittest.expect(o, unittest.hasLength(2)); |
156 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')); | 156 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')); |
157 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')); | 157 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')); |
158 } | 158 } |
159 | 159 |
160 buildUnnamed685() { | 160 buildUnnamed705() { |
161 var o = new core.Map<core.String, core.Object>(); | 161 var o = new core.Map<core.String, core.Object>(); |
162 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 162 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
163 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 163 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
164 return o; | 164 return o; |
165 } | 165 } |
166 | 166 |
167 checkUnnamed685(core.Map<core.String, core.Object> o) { | 167 checkUnnamed705(core.Map<core.String, core.Object> o) { |
168 unittest.expect(o, unittest.hasLength(2)); | 168 unittest.expect(o, unittest.hasLength(2)); |
169 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')); | 169 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')); |
170 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')); | 170 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')); |
171 } | 171 } |
172 | 172 |
173 core.int buildCounterOperation = 0; | 173 core.int buildCounterOperation = 0; |
174 buildOperation() { | 174 buildOperation() { |
175 var o = new api.Operation(); | 175 var o = new api.Operation(); |
176 buildCounterOperation++; | 176 buildCounterOperation++; |
177 if (buildCounterOperation < 3) { | 177 if (buildCounterOperation < 3) { |
178 o.done = true; | 178 o.done = true; |
179 o.error = buildStatus(); | 179 o.error = buildStatus(); |
180 o.metadata = buildUnnamed684(); | 180 o.metadata = buildUnnamed704(); |
181 o.name = "foo"; | 181 o.name = "foo"; |
182 o.response = buildUnnamed685(); | 182 o.response = buildUnnamed705(); |
183 } | 183 } |
184 buildCounterOperation--; | 184 buildCounterOperation--; |
185 return o; | 185 return o; |
186 } | 186 } |
187 | 187 |
188 checkOperation(api.Operation o) { | 188 checkOperation(api.Operation o) { |
189 buildCounterOperation++; | 189 buildCounterOperation++; |
190 if (buildCounterOperation < 3) { | 190 if (buildCounterOperation < 3) { |
191 unittest.expect(o.done, unittest.isTrue); | 191 unittest.expect(o.done, unittest.isTrue); |
192 checkStatus(o.error); | 192 checkStatus(o.error); |
193 checkUnnamed684(o.metadata); | 193 checkUnnamed704(o.metadata); |
194 unittest.expect(o.name, unittest.equals('foo')); | 194 unittest.expect(o.name, unittest.equals('foo')); |
195 checkUnnamed685(o.response); | 195 checkUnnamed705(o.response); |
196 } | 196 } |
197 buildCounterOperation--; | 197 buildCounterOperation--; |
198 } | 198 } |
199 | 199 |
200 core.int buildCounterScriptStackTraceElement = 0; | 200 core.int buildCounterScriptStackTraceElement = 0; |
201 buildScriptStackTraceElement() { | 201 buildScriptStackTraceElement() { |
202 var o = new api.ScriptStackTraceElement(); | 202 var o = new api.ScriptStackTraceElement(); |
203 buildCounterScriptStackTraceElement++; | 203 buildCounterScriptStackTraceElement++; |
204 if (buildCounterScriptStackTraceElement < 3) { | 204 if (buildCounterScriptStackTraceElement < 3) { |
205 o.function = "foo"; | 205 o.function = "foo"; |
206 o.lineNumber = 42; | 206 o.lineNumber = 42; |
207 } | 207 } |
208 buildCounterScriptStackTraceElement--; | 208 buildCounterScriptStackTraceElement--; |
209 return o; | 209 return o; |
210 } | 210 } |
211 | 211 |
212 checkScriptStackTraceElement(api.ScriptStackTraceElement o) { | 212 checkScriptStackTraceElement(api.ScriptStackTraceElement o) { |
213 buildCounterScriptStackTraceElement++; | 213 buildCounterScriptStackTraceElement++; |
214 if (buildCounterScriptStackTraceElement < 3) { | 214 if (buildCounterScriptStackTraceElement < 3) { |
215 unittest.expect(o.function, unittest.equals('foo')); | 215 unittest.expect(o.function, unittest.equals('foo')); |
216 unittest.expect(o.lineNumber, unittest.equals(42)); | 216 unittest.expect(o.lineNumber, unittest.equals(42)); |
217 } | 217 } |
218 buildCounterScriptStackTraceElement--; | 218 buildCounterScriptStackTraceElement--; |
219 } | 219 } |
220 | 220 |
221 buildUnnamed686() { | 221 buildUnnamed706() { |
222 var o = new core.Map<core.String, core.Object>(); | 222 var o = new core.Map<core.String, core.Object>(); |
223 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 223 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
224 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 224 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
225 return o; | 225 return o; |
226 } | 226 } |
227 | 227 |
228 checkUnnamed686(core.Map<core.String, core.Object> o) { | 228 checkUnnamed706(core.Map<core.String, core.Object> o) { |
229 unittest.expect(o, unittest.hasLength(2)); | 229 unittest.expect(o, unittest.hasLength(2)); |
230 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')); | 230 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')); |
231 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')); | 231 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')); |
232 } | 232 } |
233 | 233 |
234 buildUnnamed687() { | 234 buildUnnamed707() { |
235 var o = new core.List<core.Map<core.String, core.Object>>(); | 235 var o = new core.List<core.Map<core.String, core.Object>>(); |
236 o.add(buildUnnamed686()); | 236 o.add(buildUnnamed706()); |
237 o.add(buildUnnamed686()); | 237 o.add(buildUnnamed706()); |
238 return o; | 238 return o; |
239 } | 239 } |
240 | 240 |
241 checkUnnamed687(core.List<core.Map<core.String, core.Object>> o) { | 241 checkUnnamed707(core.List<core.Map<core.String, core.Object>> o) { |
242 unittest.expect(o, unittest.hasLength(2)); | 242 unittest.expect(o, unittest.hasLength(2)); |
243 checkUnnamed686(o[0]); | 243 checkUnnamed706(o[0]); |
244 checkUnnamed686(o[1]); | 244 checkUnnamed706(o[1]); |
245 } | 245 } |
246 | 246 |
247 core.int buildCounterStatus = 0; | 247 core.int buildCounterStatus = 0; |
248 buildStatus() { | 248 buildStatus() { |
249 var o = new api.Status(); | 249 var o = new api.Status(); |
250 buildCounterStatus++; | 250 buildCounterStatus++; |
251 if (buildCounterStatus < 3) { | 251 if (buildCounterStatus < 3) { |
252 o.code = 42; | 252 o.code = 42; |
253 o.details = buildUnnamed687(); | 253 o.details = buildUnnamed707(); |
254 o.message = "foo"; | 254 o.message = "foo"; |
255 } | 255 } |
256 buildCounterStatus--; | 256 buildCounterStatus--; |
257 return o; | 257 return o; |
258 } | 258 } |
259 | 259 |
260 checkStatus(api.Status o) { | 260 checkStatus(api.Status o) { |
261 buildCounterStatus++; | 261 buildCounterStatus++; |
262 if (buildCounterStatus < 3) { | 262 if (buildCounterStatus < 3) { |
263 unittest.expect(o.code, unittest.equals(42)); | 263 unittest.expect(o.code, unittest.equals(42)); |
264 checkUnnamed687(o.details); | 264 checkUnnamed707(o.details); |
265 unittest.expect(o.message, unittest.equals('foo')); | 265 unittest.expect(o.message, unittest.equals('foo')); |
266 } | 266 } |
267 buildCounterStatus--; | 267 buildCounterStatus--; |
268 } | 268 } |
269 | 269 |
270 | 270 |
271 main() { | 271 main() { |
272 unittest.group("obj-schema-ExecutionError", () { | 272 unittest.group("obj-schema-ExecutionError", () { |
273 unittest.test("to-json--from-json", () { | 273 unittest.test("to-json--from-json", () { |
274 var o = buildExecutionError(); | 274 var o = buildExecutionError(); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 res.run(arg_request, arg_scriptId).then(unittest.expectAsync(((api.Operati
on response) { | 377 res.run(arg_request, arg_scriptId).then(unittest.expectAsync(((api.Operati
on response) { |
378 checkOperation(response); | 378 checkOperation(response); |
379 }))); | 379 }))); |
380 }); | 380 }); |
381 | 381 |
382 }); | 382 }); |
383 | 383 |
384 | 384 |
385 } | 385 } |
386 | 386 |
OLD | NEW |