Index: generated/googleapis/test/script/v1_test.dart |
diff --git a/generated/googleapis/test/script/v1_test.dart b/generated/googleapis/test/script/v1_test.dart |
index 31aa646a3bfe1d3928274ef2e9ec873bf210f9f4..bf89db91020d8a92b83b5767bca5eaa174908425 100644 |
--- a/generated/googleapis/test/script/v1_test.dart |
+++ b/generated/googleapis/test/script/v1_test.dart |
@@ -1,12 +1,10 @@ |
library googleapis.script.v1.test; |
import "dart:core" as core; |
-import "dart:collection" as collection; |
import "dart:async" as async; |
import "dart:convert" as convert; |
import 'package:http/http.dart' as http; |
-import 'package:http/testing.dart' as http_testing; |
import 'package:test/test.dart' as unittest; |
import 'package:googleapis/script/v1.dart' as api; |
@@ -22,7 +20,8 @@ class HttpServerMock extends http.BaseClient { |
async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
if (_expectJson) { |
- return request.finalize() |
+ return request |
+ .finalize() |
.transform(convert.UTF8.decoder) |
.join('') |
.then((core.String jsonString) { |
@@ -45,20 +44,20 @@ class HttpServerMock extends http.BaseClient { |
} |
} |
-http.StreamedResponse stringResponse( |
- core.int status, core.Map<core.String, core.String> headers, core.String body) { |
+http.StreamedResponse stringResponse(core.int status, |
+ core.Map<core.String, core.String> headers, core.String body) { |
var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
return new http.StreamedResponse(stream, status, headers: headers); |
} |
-buildUnnamed799() { |
+buildUnnamed802() { |
var o = new core.List<api.ScriptStackTraceElement>(); |
o.add(buildScriptStackTraceElement()); |
o.add(buildScriptStackTraceElement()); |
return o; |
} |
-checkUnnamed799(core.List<api.ScriptStackTraceElement> o) { |
+checkUnnamed802(core.List<api.ScriptStackTraceElement> o) { |
unittest.expect(o, unittest.hasLength(2)); |
checkScriptStackTraceElement(o[0]); |
checkScriptStackTraceElement(o[1]); |
@@ -71,7 +70,7 @@ buildExecutionError() { |
if (buildCounterExecutionError < 3) { |
o.errorMessage = "foo"; |
o.errorType = "foo"; |
- o.scriptStackTraceElements = buildUnnamed799(); |
+ o.scriptStackTraceElements = buildUnnamed802(); |
} |
buildCounterExecutionError--; |
return o; |
@@ -82,22 +81,38 @@ checkExecutionError(api.ExecutionError o) { |
if (buildCounterExecutionError < 3) { |
unittest.expect(o.errorMessage, unittest.equals('foo')); |
unittest.expect(o.errorType, unittest.equals('foo')); |
- checkUnnamed799(o.scriptStackTraceElements); |
+ checkUnnamed802(o.scriptStackTraceElements); |
} |
buildCounterExecutionError--; |
} |
-buildUnnamed800() { |
+buildUnnamed803() { |
var o = new core.List<core.Object>(); |
- o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
- o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
+ o.add({ |
+ 'list': [1, 2, 3], |
+ 'bool': true, |
+ 'string': 'foo' |
+ }); |
+ o.add({ |
+ 'list': [1, 2, 3], |
+ 'bool': true, |
+ 'string': 'foo' |
+ }); |
return o; |
} |
-checkUnnamed800(core.List<core.Object> o) { |
+checkUnnamed803(core.List<core.Object> o) { |
unittest.expect(o, unittest.hasLength(2)); |
- var casted1 = (o[0]) as core.Map; unittest.expect(casted1, unittest.hasLength(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], unittest.equals('foo')); |
- var casted2 = (o[1]) as core.Map; unittest.expect(casted2, unittest.hasLength(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], unittest.equals('foo')); |
+ var casted1 = (o[0]) as core.Map; |
+ unittest.expect(casted1, unittest.hasLength(3)); |
+ unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); |
+ unittest.expect(casted1["bool"], unittest.equals(true)); |
+ unittest.expect(casted1["string"], unittest.equals('foo')); |
+ var casted2 = (o[1]) as core.Map; |
+ unittest.expect(casted2, unittest.hasLength(3)); |
+ unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); |
+ unittest.expect(casted2["bool"], unittest.equals(true)); |
+ unittest.expect(casted2["string"], unittest.equals('foo')); |
} |
core.int buildCounterExecutionRequest = 0; |
@@ -107,7 +122,7 @@ buildExecutionRequest() { |
if (buildCounterExecutionRequest < 3) { |
o.devMode = true; |
o.function = "foo"; |
- o.parameters = buildUnnamed800(); |
+ o.parameters = buildUnnamed803(); |
o.sessionState = "foo"; |
} |
buildCounterExecutionRequest--; |
@@ -119,7 +134,7 @@ checkExecutionRequest(api.ExecutionRequest o) { |
if (buildCounterExecutionRequest < 3) { |
unittest.expect(o.devMode, unittest.isTrue); |
unittest.expect(o.function, unittest.equals('foo')); |
- checkUnnamed800(o.parameters); |
+ checkUnnamed803(o.parameters); |
unittest.expect(o.sessionState, unittest.equals('foo')); |
} |
buildCounterExecutionRequest--; |
@@ -130,7 +145,11 @@ buildExecutionResponse() { |
var o = new api.ExecutionResponse(); |
buildCounterExecutionResponse++; |
if (buildCounterExecutionResponse < 3) { |
- o.result = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
+ o.result = { |
+ 'list': [1, 2, 3], |
+ 'bool': true, |
+ 'string': 'foo' |
+ }; |
} |
buildCounterExecutionResponse--; |
return o; |
@@ -139,35 +158,71 @@ buildExecutionResponse() { |
checkExecutionResponse(api.ExecutionResponse o) { |
buildCounterExecutionResponse++; |
if (buildCounterExecutionResponse < 3) { |
- var casted3 = (o.result) as core.Map; unittest.expect(casted3, unittest.hasLength(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.expect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"], unittest.equals('foo')); |
+ var casted3 = (o.result) as core.Map; |
+ unittest.expect(casted3, unittest.hasLength(3)); |
+ unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); |
+ unittest.expect(casted3["bool"], unittest.equals(true)); |
+ unittest.expect(casted3["string"], unittest.equals('foo')); |
} |
buildCounterExecutionResponse--; |
} |
-buildUnnamed801() { |
+buildUnnamed804() { |
var o = new core.Map<core.String, core.Object>(); |
- o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
- o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
+ o["x"] = { |
+ 'list': [1, 2, 3], |
+ 'bool': true, |
+ 'string': 'foo' |
+ }; |
+ o["y"] = { |
+ 'list': [1, 2, 3], |
+ 'bool': true, |
+ 'string': 'foo' |
+ }; |
return o; |
} |
-checkUnnamed801(core.Map<core.String, core.Object> o) { |
+checkUnnamed804(core.Map<core.String, core.Object> o) { |
unittest.expect(o, unittest.hasLength(2)); |
- var casted4 = (o["x"]) as core.Map; unittest.expect(casted4, unittest.hasLength(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.expect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"], unittest.equals('foo')); |
- var casted5 = (o["y"]) as core.Map; unittest.expect(casted5, unittest.hasLength(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.expect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"], unittest.equals('foo')); |
+ var casted4 = (o["x"]) as core.Map; |
+ unittest.expect(casted4, unittest.hasLength(3)); |
+ unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); |
+ unittest.expect(casted4["bool"], unittest.equals(true)); |
+ unittest.expect(casted4["string"], unittest.equals('foo')); |
+ var casted5 = (o["y"]) as core.Map; |
+ unittest.expect(casted5, unittest.hasLength(3)); |
+ unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); |
+ unittest.expect(casted5["bool"], unittest.equals(true)); |
+ unittest.expect(casted5["string"], unittest.equals('foo')); |
} |
-buildUnnamed802() { |
+buildUnnamed805() { |
var o = new core.Map<core.String, core.Object>(); |
- o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
- o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
+ o["x"] = { |
+ 'list': [1, 2, 3], |
+ 'bool': true, |
+ 'string': 'foo' |
+ }; |
+ o["y"] = { |
+ 'list': [1, 2, 3], |
+ 'bool': true, |
+ 'string': 'foo' |
+ }; |
return o; |
} |
-checkUnnamed802(core.Map<core.String, core.Object> o) { |
+checkUnnamed805(core.Map<core.String, core.Object> o) { |
unittest.expect(o, unittest.hasLength(2)); |
- var casted6 = (o["x"]) as core.Map; unittest.expect(casted6, unittest.hasLength(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.expect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"], unittest.equals('foo')); |
- var casted7 = (o["y"]) as core.Map; unittest.expect(casted7, unittest.hasLength(3)); unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); unittest.expect(casted7["bool"], unittest.equals(true)); unittest.expect(casted7["string"], unittest.equals('foo')); |
+ var casted6 = (o["x"]) as core.Map; |
+ unittest.expect(casted6, unittest.hasLength(3)); |
+ unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); |
+ unittest.expect(casted6["bool"], unittest.equals(true)); |
+ unittest.expect(casted6["string"], unittest.equals('foo')); |
+ var casted7 = (o["y"]) as core.Map; |
+ unittest.expect(casted7, unittest.hasLength(3)); |
+ unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); |
+ unittest.expect(casted7["bool"], unittest.equals(true)); |
+ unittest.expect(casted7["string"], unittest.equals('foo')); |
} |
core.int buildCounterOperation = 0; |
@@ -177,9 +232,8 @@ buildOperation() { |
if (buildCounterOperation < 3) { |
o.done = true; |
o.error = buildStatus(); |
- o.metadata = buildUnnamed801(); |
- o.name = "foo"; |
- o.response = buildUnnamed802(); |
+ o.metadata = buildUnnamed804(); |
+ o.response = buildUnnamed805(); |
} |
buildCounterOperation--; |
return o; |
@@ -190,9 +244,8 @@ checkOperation(api.Operation o) { |
if (buildCounterOperation < 3) { |
unittest.expect(o.done, unittest.isTrue); |
checkStatus(o.error); |
- checkUnnamed801(o.metadata); |
- unittest.expect(o.name, unittest.equals('foo')); |
- checkUnnamed802(o.response); |
+ checkUnnamed804(o.metadata); |
+ checkUnnamed805(o.response); |
} |
buildCounterOperation--; |
} |
@@ -218,30 +271,46 @@ checkScriptStackTraceElement(api.ScriptStackTraceElement o) { |
buildCounterScriptStackTraceElement--; |
} |
-buildUnnamed803() { |
+buildUnnamed806() { |
var o = new core.Map<core.String, core.Object>(); |
- o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
- o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
+ o["x"] = { |
+ 'list': [1, 2, 3], |
+ 'bool': true, |
+ 'string': 'foo' |
+ }; |
+ o["y"] = { |
+ 'list': [1, 2, 3], |
+ 'bool': true, |
+ 'string': 'foo' |
+ }; |
return o; |
} |
-checkUnnamed803(core.Map<core.String, core.Object> o) { |
+checkUnnamed806(core.Map<core.String, core.Object> o) { |
unittest.expect(o, unittest.hasLength(2)); |
- var casted8 = (o["x"]) as core.Map; unittest.expect(casted8, unittest.hasLength(3)); unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); unittest.expect(casted8["bool"], unittest.equals(true)); unittest.expect(casted8["string"], unittest.equals('foo')); |
- var casted9 = (o["y"]) as core.Map; unittest.expect(casted9, unittest.hasLength(3)); unittest.expect(casted9["list"], unittest.equals([1, 2, 3])); unittest.expect(casted9["bool"], unittest.equals(true)); unittest.expect(casted9["string"], unittest.equals('foo')); |
+ var casted8 = (o["x"]) as core.Map; |
+ unittest.expect(casted8, unittest.hasLength(3)); |
+ unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); |
+ unittest.expect(casted8["bool"], unittest.equals(true)); |
+ unittest.expect(casted8["string"], unittest.equals('foo')); |
+ var casted9 = (o["y"]) as core.Map; |
+ unittest.expect(casted9, unittest.hasLength(3)); |
+ unittest.expect(casted9["list"], unittest.equals([1, 2, 3])); |
+ unittest.expect(casted9["bool"], unittest.equals(true)); |
+ unittest.expect(casted9["string"], unittest.equals('foo')); |
} |
-buildUnnamed804() { |
+buildUnnamed807() { |
var o = new core.List<core.Map<core.String, core.Object>>(); |
- o.add(buildUnnamed803()); |
- o.add(buildUnnamed803()); |
+ o.add(buildUnnamed806()); |
+ o.add(buildUnnamed806()); |
return o; |
} |
-checkUnnamed804(core.List<core.Map<core.String, core.Object>> o) { |
+checkUnnamed807(core.List<core.Map<core.String, core.Object>> o) { |
unittest.expect(o, unittest.hasLength(2)); |
- checkUnnamed803(o[0]); |
- checkUnnamed803(o[1]); |
+ checkUnnamed806(o[0]); |
+ checkUnnamed806(o[1]); |
} |
core.int buildCounterStatus = 0; |
@@ -250,7 +319,7 @@ buildStatus() { |
buildCounterStatus++; |
if (buildCounterStatus < 3) { |
o.code = 42; |
- o.details = buildUnnamed804(); |
+ o.details = buildUnnamed807(); |
o.message = "foo"; |
} |
buildCounterStatus--; |
@@ -261,13 +330,12 @@ checkStatus(api.Status o) { |
buildCounterStatus++; |
if (buildCounterStatus < 3) { |
unittest.expect(o.code, unittest.equals(42)); |
- checkUnnamed804(o.details); |
+ checkUnnamed807(o.details); |
unittest.expect(o.message, unittest.equals('foo')); |
} |
buildCounterStatus--; |
} |
- |
main() { |
unittest.group("obj-schema-ExecutionError", () { |
unittest.test("to-json--from-json", () { |
@@ -277,7 +345,6 @@ main() { |
}); |
}); |
- |
unittest.group("obj-schema-ExecutionRequest", () { |
unittest.test("to-json--from-json", () { |
var o = buildExecutionRequest(); |
@@ -286,7 +353,6 @@ main() { |
}); |
}); |
- |
unittest.group("obj-schema-ExecutionResponse", () { |
unittest.test("to-json--from-json", () { |
var o = buildExecutionResponse(); |
@@ -295,7 +361,6 @@ main() { |
}); |
}); |
- |
unittest.group("obj-schema-Operation", () { |
unittest.test("to-json--from-json", () { |
var o = buildOperation(); |
@@ -304,7 +369,6 @@ main() { |
}); |
}); |
- |
unittest.group("obj-schema-ScriptStackTraceElement", () { |
unittest.test("to-json--from-json", () { |
var o = buildScriptStackTraceElement(); |
@@ -313,7 +377,6 @@ main() { |
}); |
}); |
- |
unittest.group("obj-schema-Status", () { |
unittest.test("to-json--from-json", () { |
var o = buildStatus(); |
@@ -322,10 +385,8 @@ main() { |
}); |
}); |
- |
unittest.group("resource-ScriptsResourceApi", () { |
unittest.test("method--run", () { |
- |
var mock = new HttpServerMock(); |
api.ScriptsResourceApi res = new api.ScriptApi(mock).scripts; |
var arg_request = buildExecutionRequest(); |
@@ -338,16 +399,20 @@ main() { |
var pathOffset = 0; |
var index; |
var subPart; |
- unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
+ unittest.expect( |
+ path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
pathOffset += 1; |
- unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("v1/scripts/")); |
+ unittest.expect(path.substring(pathOffset, pathOffset + 11), |
+ unittest.equals("v1/scripts/")); |
pathOffset += 11; |
index = path.indexOf(":run", pathOffset); |
unittest.expect(index >= 0, unittest.isTrue); |
- subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
+ subPart = |
+ core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
pathOffset = index; |
unittest.expect(subPart, unittest.equals("$arg_scriptId")); |
- unittest.expect(path.substring(pathOffset, pathOffset + 4), unittest.equals(":run")); |
+ unittest.expect(path.substring(pathOffset, pathOffset + 4), |
+ unittest.equals(":run")); |
pathOffset += 4; |
var query = (req.url).query; |
@@ -360,27 +425,26 @@ main() { |
if (n == null) return null; |
throw new core.ArgumentError("Invalid boolean: $n"); |
} |
+ |
if (query.length > 0) { |
for (var part in query.split("&")) { |
var keyvalue = part.split("="); |
- addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
+ core.Uri.decodeQueryComponent(keyvalue[1])); |
} |
} |
- |
var h = { |
- "content-type" : "application/json; charset=utf-8", |
+ "content-type": "application/json; charset=utf-8", |
}; |
var resp = convert.JSON.encode(buildOperation()); |
return new async.Future.value(stringResponse(200, h, resp)); |
}), true); |
- res.run(arg_request, arg_scriptId).then(unittest.expectAsync1(((api.Operation response) { |
+ res |
+ .run(arg_request, arg_scriptId) |
+ .then(unittest.expectAsync1(((api.Operation response) { |
checkOperation(response); |
}))); |
}); |
- |
}); |
- |
- |
} |
- |