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