Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: generated/googleapis/test/runtimeconfig/v1_test.dart

Issue 3006323002: Api-Roll 54: 2017-09-11 (Closed)
Patch Set: use 2.0.0-dev.infinity sdk constraint in pubspecs Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: generated/googleapis/test/runtimeconfig/v1_test.dart
diff --git a/generated/googleapis/test/runtimeconfig/v1_test.dart b/generated/googleapis/test/runtimeconfig/v1_test.dart
index fd0d25b12abe5436bca94e833aff164a3cbb3c65..8f44dabb3f74b3991ce2c23aa8f4b2cd061a3dba 100644
--- a/generated/googleapis/test/runtimeconfig/v1_test.dart
+++ b/generated/googleapis/test/runtimeconfig/v1_test.dart
@@ -1,12 +1,10 @@
library googleapis.runtimeconfig.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/runtimeconfig/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,8 +44,8 @@ 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);
}
@@ -55,16 +54,14 @@ core.int buildCounterCancelOperationRequest = 0;
buildCancelOperationRequest() {
var o = new api.CancelOperationRequest();
buildCounterCancelOperationRequest++;
- if (buildCounterCancelOperationRequest < 3) {
- }
+ if (buildCounterCancelOperationRequest < 3) {}
buildCounterCancelOperationRequest--;
return o;
}
checkCancelOperationRequest(api.CancelOperationRequest o) {
buildCounterCancelOperationRequest++;
- if (buildCounterCancelOperationRequest < 3) {
- }
+ if (buildCounterCancelOperationRequest < 3) {}
buildCounterCancelOperationRequest--;
}
@@ -72,27 +69,25 @@ core.int buildCounterEmpty = 0;
buildEmpty() {
var o = new api.Empty();
buildCounterEmpty++;
- if (buildCounterEmpty < 3) {
- }
+ if (buildCounterEmpty < 3) {}
buildCounterEmpty--;
return o;
}
checkEmpty(api.Empty o) {
buildCounterEmpty++;
- if (buildCounterEmpty < 3) {
- }
+ if (buildCounterEmpty < 3) {}
buildCounterEmpty--;
}
-buildUnnamed1946() {
+buildUnnamed1944() {
var o = new core.List<api.Operation>();
o.add(buildOperation());
o.add(buildOperation());
return o;
}
-checkUnnamed1946(core.List<api.Operation> o) {
+checkUnnamed1944(core.List<api.Operation> o) {
unittest.expect(o, unittest.hasLength(2));
checkOperation(o[0]);
checkOperation(o[1]);
@@ -104,7 +99,7 @@ buildListOperationsResponse() {
buildCounterListOperationsResponse++;
if (buildCounterListOperationsResponse < 3) {
o.nextPageToken = "foo";
- o.operations = buildUnnamed1946();
+ o.operations = buildUnnamed1944();
}
buildCounterListOperationsResponse--;
return o;
@@ -114,35 +109,67 @@ checkListOperationsResponse(api.ListOperationsResponse o) {
buildCounterListOperationsResponse++;
if (buildCounterListOperationsResponse < 3) {
unittest.expect(o.nextPageToken, unittest.equals('foo'));
- checkUnnamed1946(o.operations);
+ checkUnnamed1944(o.operations);
}
buildCounterListOperationsResponse--;
}
-buildUnnamed1947() {
+buildUnnamed1945() {
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;
}
-checkUnnamed1947(core.Map<core.String, core.Object> o) {
+checkUnnamed1945(core.Map<core.String, core.Object> o) {
unittest.expect(o, unittest.hasLength(2));
- var casted1 = (o["x"]) 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["y"]) 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["x"]) 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["y"]) 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'));
}
-buildUnnamed1948() {
+buildUnnamed1946() {
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;
}
-checkUnnamed1948(core.Map<core.String, core.Object> o) {
+checkUnnamed1946(core.Map<core.String, core.Object> o) {
unittest.expect(o, unittest.hasLength(2));
- var casted3 = (o["x"]) 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 casted4 = (o["y"]) 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 casted3 = (o["x"]) 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 casted4 = (o["y"]) 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'));
}
core.int buildCounterOperation = 0;
@@ -152,9 +179,9 @@ buildOperation() {
if (buildCounterOperation < 3) {
o.done = true;
o.error = buildStatus();
- o.metadata = buildUnnamed1947();
+ o.metadata = buildUnnamed1945();
o.name = "foo";
- o.response = buildUnnamed1948();
+ o.response = buildUnnamed1946();
}
buildCounterOperation--;
return o;
@@ -165,37 +192,53 @@ checkOperation(api.Operation o) {
if (buildCounterOperation < 3) {
unittest.expect(o.done, unittest.isTrue);
checkStatus(o.error);
- checkUnnamed1947(o.metadata);
+ checkUnnamed1945(o.metadata);
unittest.expect(o.name, unittest.equals('foo'));
- checkUnnamed1948(o.response);
+ checkUnnamed1946(o.response);
}
buildCounterOperation--;
}
-buildUnnamed1949() {
+buildUnnamed1947() {
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;
}
-checkUnnamed1949(core.Map<core.String, core.Object> o) {
+checkUnnamed1947(core.Map<core.String, core.Object> o) {
unittest.expect(o, unittest.hasLength(2));
- var casted5 = (o["x"]) 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 casted6 = (o["y"]) 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 casted5 = (o["x"]) 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 casted6 = (o["y"]) 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'));
}
-buildUnnamed1950() {
+buildUnnamed1948() {
var o = new core.List<core.Map<core.String, core.Object>>();
- o.add(buildUnnamed1949());
- o.add(buildUnnamed1949());
+ o.add(buildUnnamed1947());
+ o.add(buildUnnamed1947());
return o;
}
-checkUnnamed1950(core.List<core.Map<core.String, core.Object>> o) {
+checkUnnamed1948(core.List<core.Map<core.String, core.Object>> o) {
unittest.expect(o, unittest.hasLength(2));
- checkUnnamed1949(o[0]);
- checkUnnamed1949(o[1]);
+ checkUnnamed1947(o[0]);
+ checkUnnamed1947(o[1]);
}
core.int buildCounterStatus = 0;
@@ -204,7 +247,7 @@ buildStatus() {
buildCounterStatus++;
if (buildCounterStatus < 3) {
o.code = 42;
- o.details = buildUnnamed1950();
+ o.details = buildUnnamed1948();
o.message = "foo";
}
buildCounterStatus--;
@@ -215,13 +258,12 @@ checkStatus(api.Status o) {
buildCounterStatus++;
if (buildCounterStatus < 3) {
unittest.expect(o.code, unittest.equals(42));
- checkUnnamed1950(o.details);
+ checkUnnamed1948(o.details);
unittest.expect(o.message, unittest.equals('foo'));
}
buildCounterStatus--;
}
-
main() {
unittest.group("obj-schema-CancelOperationRequest", () {
unittest.test("to-json--from-json", () {
@@ -231,7 +273,6 @@ main() {
});
});
-
unittest.group("obj-schema-Empty", () {
unittest.test("to-json--from-json", () {
var o = buildEmpty();
@@ -240,7 +281,6 @@ main() {
});
});
-
unittest.group("obj-schema-ListOperationsResponse", () {
unittest.test("to-json--from-json", () {
var o = buildListOperationsResponse();
@@ -249,7 +289,6 @@ main() {
});
});
-
unittest.group("obj-schema-Operation", () {
unittest.test("to-json--from-json", () {
var o = buildOperation();
@@ -258,7 +297,6 @@ main() {
});
});
-
unittest.group("obj-schema-Status", () {
unittest.test("to-json--from-json", () {
var o = buildStatus();
@@ -267,10 +305,8 @@ main() {
});
});
-
unittest.group("resource-OperationsResourceApi", () {
unittest.test("method--cancel", () {
-
var mock = new HttpServerMock();
api.OperationsResourceApi res = new api.RuntimeconfigApi(mock).operations;
var arg_request = buildCancelOperationRequest();
@@ -283,9 +319,11 @@ 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 + 3), unittest.equals("v1/"));
+ unittest.expect(
+ path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
pathOffset += 3;
// NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
@@ -299,27 +337,29 @@ 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(buildEmpty());
return new async.Future.value(stringResponse(200, h, resp));
}), true);
- res.cancel(arg_request, arg_name).then(unittest.expectAsync1(((api.Empty response) {
+ res
+ .cancel(arg_request, arg_name)
+ .then(unittest.expectAsync1(((api.Empty response) {
checkEmpty(response);
})));
});
unittest.test("method--delete", () {
-
var mock = new HttpServerMock();
api.OperationsResourceApi res = new api.RuntimeconfigApi(mock).operations;
var arg_name = "foo";
@@ -328,9 +368,11 @@ 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 + 3), unittest.equals("v1/"));
+ unittest.expect(
+ path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
pathOffset += 3;
// NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
@@ -344,16 +386,17 @@ 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(buildEmpty());
return new async.Future.value(stringResponse(200, h, resp));
@@ -364,21 +407,22 @@ main() {
});
unittest.test("method--list", () {
-
var mock = new HttpServerMock();
api.OperationsResourceApi res = new api.RuntimeconfigApi(mock).operations;
var arg_name = "foo";
+ var arg_filter = "foo";
var arg_pageToken = "foo";
var arg_pageSize = 42;
- var arg_filter = "foo";
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
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 + 3), unittest.equals("v1/"));
+ unittest.expect(
+ path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
pathOffset += 3;
// NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
@@ -392,30 +436,34 @@ 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]));
}
}
- unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken));
- unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equals(arg_pageSize));
unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
-
+ unittest.expect(
+ queryMap["pageToken"].first, unittest.equals(arg_pageToken));
+ unittest.expect(core.int.parse(queryMap["pageSize"].first),
+ unittest.equals(arg_pageSize));
var h = {
- "content-type" : "application/json; charset=utf-8",
+ "content-type": "application/json; charset=utf-8",
};
var resp = convert.JSON.encode(buildListOperationsResponse());
return new async.Future.value(stringResponse(200, h, resp));
}), true);
- res.list(arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize, filter: arg_filter).then(unittest.expectAsync1(((api.ListOperationsResponse response) {
+ res
+ .list(arg_name,
+ filter: arg_filter,
+ pageToken: arg_pageToken,
+ pageSize: arg_pageSize)
+ .then(unittest.expectAsync1(((api.ListOperationsResponse response) {
checkListOperationsResponse(response);
})));
});
-
});
-
-
}
-
« no previous file with comments | « generated/googleapis/test/reseller/v1_test.dart ('k') | generated/googleapis/test/safebrowsing/v4_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698