Api-Roll 54: 2017-09-11 Review-Url: https://codereview.chromium.org//3006323002 .
diff --git a/generated/googleapis/test/manufacturers/v1_test.dart b/generated/googleapis/test/manufacturers/v1_test.dart index f73a210..6518235 100644 --- a/generated/googleapis/test/manufacturers/v1_test.dart +++ b/generated/googleapis/test/manufacturers/v1_test.dart
@@ -1,12 +1,10 @@ library googleapis.manufacturers.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/manufacturers/v1.dart' as api; @@ -22,7 +20,8 @@ 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,85 +44,85 @@ } } -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); } -buildUnnamed1604() { +buildUnnamed1599() { var o = new core.List<api.Image>(); o.add(buildImage()); o.add(buildImage()); return o; } -checkUnnamed1604(core.List<api.Image> o) { +checkUnnamed1599(core.List<api.Image> o) { unittest.expect(o, unittest.hasLength(2)); checkImage(o[0]); checkImage(o[1]); } -buildUnnamed1605() { +buildUnnamed1600() { var o = new core.List<api.FeatureDescription>(); o.add(buildFeatureDescription()); o.add(buildFeatureDescription()); return o; } -checkUnnamed1605(core.List<api.FeatureDescription> o) { +checkUnnamed1600(core.List<api.FeatureDescription> o) { unittest.expect(o, unittest.hasLength(2)); checkFeatureDescription(o[0]); checkFeatureDescription(o[1]); } -buildUnnamed1606() { +buildUnnamed1601() { var o = new core.List<core.String>(); o.add("foo"); o.add("foo"); return o; } -checkUnnamed1606(core.List<core.String> o) { +checkUnnamed1601(core.List<core.String> o) { unittest.expect(o, unittest.hasLength(2)); unittest.expect(o[0], unittest.equals('foo')); unittest.expect(o[1], unittest.equals('foo')); } -buildUnnamed1607() { +buildUnnamed1602() { var o = new core.List<api.ProductDetail>(); o.add(buildProductDetail()); o.add(buildProductDetail()); return o; } -checkUnnamed1607(core.List<api.ProductDetail> o) { +checkUnnamed1602(core.List<api.ProductDetail> o) { unittest.expect(o, unittest.hasLength(2)); checkProductDetail(o[0]); checkProductDetail(o[1]); } -buildUnnamed1608() { +buildUnnamed1603() { var o = new core.List<core.String>(); o.add("foo"); o.add("foo"); return o; } -checkUnnamed1608(core.List<core.String> o) { +checkUnnamed1603(core.List<core.String> o) { unittest.expect(o, unittest.hasLength(2)); unittest.expect(o[0], unittest.equals('foo')); unittest.expect(o[1], unittest.equals('foo')); } -buildUnnamed1609() { +buildUnnamed1604() { var o = new core.List<core.String>(); o.add("foo"); o.add("foo"); return o; } -checkUnnamed1609(core.List<core.String> o) { +checkUnnamed1604(core.List<core.String> o) { unittest.expect(o, unittest.hasLength(2)); unittest.expect(o[0], unittest.equals('foo')); unittest.expect(o[1], unittest.equals('foo')); @@ -134,7 +133,7 @@ var o = new api.Attributes(); buildCounterAttributes++; if (buildCounterAttributes < 3) { - o.additionalImageLink = buildUnnamed1604(); + o.additionalImageLink = buildUnnamed1599(); o.ageGroup = "foo"; o.brand = "foo"; o.capacity = buildCapacity(); @@ -142,21 +141,21 @@ o.count = buildCount(); o.description = "foo"; o.disclosureDate = "foo"; - o.featureDescription = buildUnnamed1605(); + o.featureDescription = buildUnnamed1600(); o.flavor = "foo"; o.format = "foo"; o.gender = "foo"; - o.gtin = buildUnnamed1606(); + o.gtin = buildUnnamed1601(); o.imageLink = buildImage(); o.itemGroupId = "foo"; o.material = "foo"; o.mpn = "foo"; o.pattern = "foo"; - o.productDetail = buildUnnamed1607(); + o.productDetail = buildUnnamed1602(); o.productLine = "foo"; o.productName = "foo"; o.productPageUrl = "foo"; - o.productType = buildUnnamed1608(); + o.productType = buildUnnamed1603(); o.releaseDate = "foo"; o.scent = "foo"; o.size = "foo"; @@ -166,7 +165,7 @@ o.targetAccountId = "foo"; o.theme = "foo"; o.title = "foo"; - o.videoLink = buildUnnamed1609(); + o.videoLink = buildUnnamed1604(); } buildCounterAttributes--; return o; @@ -175,7 +174,7 @@ checkAttributes(api.Attributes o) { buildCounterAttributes++; if (buildCounterAttributes < 3) { - checkUnnamed1604(o.additionalImageLink); + checkUnnamed1599(o.additionalImageLink); unittest.expect(o.ageGroup, unittest.equals('foo')); unittest.expect(o.brand, unittest.equals('foo')); checkCapacity(o.capacity); @@ -183,21 +182,21 @@ checkCount(o.count); unittest.expect(o.description, unittest.equals('foo')); unittest.expect(o.disclosureDate, unittest.equals('foo')); - checkUnnamed1605(o.featureDescription); + checkUnnamed1600(o.featureDescription); unittest.expect(o.flavor, unittest.equals('foo')); unittest.expect(o.format, unittest.equals('foo')); unittest.expect(o.gender, unittest.equals('foo')); - checkUnnamed1606(o.gtin); + checkUnnamed1601(o.gtin); checkImage(o.imageLink); unittest.expect(o.itemGroupId, unittest.equals('foo')); unittest.expect(o.material, unittest.equals('foo')); unittest.expect(o.mpn, unittest.equals('foo')); unittest.expect(o.pattern, unittest.equals('foo')); - checkUnnamed1607(o.productDetail); + checkUnnamed1602(o.productDetail); unittest.expect(o.productLine, unittest.equals('foo')); unittest.expect(o.productName, unittest.equals('foo')); unittest.expect(o.productPageUrl, unittest.equals('foo')); - checkUnnamed1608(o.productType); + checkUnnamed1603(o.productType); unittest.expect(o.releaseDate, unittest.equals('foo')); unittest.expect(o.scent, unittest.equals('foo')); unittest.expect(o.size, unittest.equals('foo')); @@ -207,7 +206,7 @@ unittest.expect(o.targetAccountId, unittest.equals('foo')); unittest.expect(o.theme, unittest.equals('foo')); unittest.expect(o.title, unittest.equals('foo')); - checkUnnamed1609(o.videoLink); + checkUnnamed1604(o.videoLink); } buildCounterAttributes--; } @@ -258,16 +257,14 @@ 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--; } @@ -344,14 +341,14 @@ buildCounterIssue--; } -buildUnnamed1610() { +buildUnnamed1605() { var o = new core.List<api.Product>(); o.add(buildProduct()); o.add(buildProduct()); return o; } -checkUnnamed1610(core.List<api.Product> o) { +checkUnnamed1605(core.List<api.Product> o) { unittest.expect(o, unittest.hasLength(2)); checkProduct(o[0]); checkProduct(o[1]); @@ -363,7 +360,7 @@ buildCounterListProductsResponse++; if (buildCounterListProductsResponse < 3) { o.nextPageToken = "foo"; - o.products = buildUnnamed1610(); + o.products = buildUnnamed1605(); } buildCounterListProductsResponse--; return o; @@ -373,7 +370,7 @@ buildCounterListProductsResponse++; if (buildCounterListProductsResponse < 3) { unittest.expect(o.nextPageToken, unittest.equals('foo')); - checkUnnamed1610(o.products); + checkUnnamed1605(o.products); } buildCounterListProductsResponse--; } @@ -399,27 +396,27 @@ buildCounterPrice--; } -buildUnnamed1611() { +buildUnnamed1606() { var o = new core.List<api.Issue>(); o.add(buildIssue()); o.add(buildIssue()); return o; } -checkUnnamed1611(core.List<api.Issue> o) { +checkUnnamed1606(core.List<api.Issue> o) { unittest.expect(o, unittest.hasLength(2)); checkIssue(o[0]); checkIssue(o[1]); } -buildUnnamed1612() { +buildUnnamed1607() { var o = new core.List<core.String>(); o.add("foo"); o.add("foo"); return o; } -checkUnnamed1612(core.List<core.String> o) { +checkUnnamed1607(core.List<core.String> o) { unittest.expect(o, unittest.hasLength(2)); unittest.expect(o[0], unittest.equals('foo')); unittest.expect(o[1], unittest.equals('foo')); @@ -432,8 +429,8 @@ if (buildCounterProduct < 3) { o.contentLanguage = "foo"; o.finalAttributes = buildAttributes(); - o.issues = buildUnnamed1611(); - o.manuallyDeletedAttributes = buildUnnamed1612(); + o.issues = buildUnnamed1606(); + o.manuallyDeletedAttributes = buildUnnamed1607(); o.manuallyProvidedAttributes = buildAttributes(); o.name = "foo"; o.parent = "foo"; @@ -450,8 +447,8 @@ if (buildCounterProduct < 3) { unittest.expect(o.contentLanguage, unittest.equals('foo')); checkAttributes(o.finalAttributes); - checkUnnamed1611(o.issues); - checkUnnamed1612(o.manuallyDeletedAttributes); + checkUnnamed1606(o.issues); + checkUnnamed1607(o.manuallyDeletedAttributes); checkAttributes(o.manuallyProvidedAttributes); unittest.expect(o.name, unittest.equals('foo')); unittest.expect(o.parent, unittest.equals('foo')); @@ -485,7 +482,6 @@ buildCounterProductDetail--; } - main() { unittest.group("obj-schema-Attributes", () { unittest.test("to-json--from-json", () { @@ -495,7 +491,6 @@ }); }); - unittest.group("obj-schema-Capacity", () { unittest.test("to-json--from-json", () { var o = buildCapacity(); @@ -504,7 +499,6 @@ }); }); - unittest.group("obj-schema-Count", () { unittest.test("to-json--from-json", () { var o = buildCount(); @@ -513,7 +507,6 @@ }); }); - unittest.group("obj-schema-Empty", () { unittest.test("to-json--from-json", () { var o = buildEmpty(); @@ -522,7 +515,6 @@ }); }); - unittest.group("obj-schema-FeatureDescription", () { unittest.test("to-json--from-json", () { var o = buildFeatureDescription(); @@ -531,7 +523,6 @@ }); }); - unittest.group("obj-schema-Image", () { unittest.test("to-json--from-json", () { var o = buildImage(); @@ -540,7 +531,6 @@ }); }); - unittest.group("obj-schema-Issue", () { unittest.test("to-json--from-json", () { var o = buildIssue(); @@ -549,7 +539,6 @@ }); }); - unittest.group("obj-schema-ListProductsResponse", () { unittest.test("to-json--from-json", () { var o = buildListProductsResponse(); @@ -558,7 +547,6 @@ }); }); - unittest.group("obj-schema-Price", () { unittest.test("to-json--from-json", () { var o = buildPrice(); @@ -567,7 +555,6 @@ }); }); - unittest.group("obj-schema-Product", () { unittest.test("to-json--from-json", () { var o = buildProduct(); @@ -576,7 +563,6 @@ }); }); - unittest.group("obj-schema-ProductDetail", () { unittest.test("to-json--from-json", () { var o = buildProductDetail(); @@ -585,12 +571,11 @@ }); }); - unittest.group("resource-AccountsProductsResourceApi", () { unittest.test("method--delete", () { - var mock = new HttpServerMock(); - api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accounts.products; + api.AccountsProductsResourceApi res = + new api.ManufacturersApi(mock).accounts.products; var arg_parent = "foo"; var arg_name = "foo"; mock.register(unittest.expectAsync2((http.BaseRequest req, json) { @@ -598,9 +583,11 @@ 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; @@ -614,29 +601,32 @@ 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.delete(arg_parent, arg_name).then(unittest.expectAsync1(((api.Empty response) { + res + .delete(arg_parent, arg_name) + .then(unittest.expectAsync1(((api.Empty response) { checkEmpty(response); }))); }); unittest.test("method--get", () { - var mock = new HttpServerMock(); - api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accounts.products; + api.AccountsProductsResourceApi res = + new api.ManufacturersApi(mock).accounts.products; var arg_parent = "foo"; var arg_name = "foo"; mock.register(unittest.expectAsync2((http.BaseRequest req, json) { @@ -644,9 +634,11 @@ 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; @@ -660,29 +652,32 @@ 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(buildProduct()); return new async.Future.value(stringResponse(200, h, resp)); }), true); - res.get(arg_parent, arg_name).then(unittest.expectAsync1(((api.Product response) { + res + .get(arg_parent, arg_name) + .then(unittest.expectAsync1(((api.Product response) { checkProduct(response); }))); }); unittest.test("method--list", () { - var mock = new HttpServerMock(); - api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accounts.products; + api.AccountsProductsResourceApi res = + new api.ManufacturersApi(mock).accounts.products; var arg_parent = "foo"; var arg_pageToken = "foo"; var arg_pageSize = 42; @@ -691,9 +686,11 @@ 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; @@ -707,31 +704,36 @@ 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["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(buildListProductsResponse()); return new async.Future.value(stringResponse(200, h, resp)); }), true); - res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).then(unittest.expectAsync1(((api.ListProductsResponse response) { + res + .list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize) + .then(unittest.expectAsync1(((api.ListProductsResponse response) { checkListProductsResponse(response); }))); }); unittest.test("method--update", () { - var mock = new HttpServerMock(); - api.AccountsProductsResourceApi res = new api.ManufacturersApi(mock).accounts.products; + api.AccountsProductsResourceApi res = + new api.ManufacturersApi(mock).accounts.products; var arg_request = buildProduct(); var arg_parent = "foo"; var arg_name = "foo"; @@ -743,9 +745,11 @@ 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; @@ -759,27 +763,26 @@ 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(buildProduct()); return new async.Future.value(stringResponse(200, h, resp)); }), true); - res.update(arg_request, arg_parent, arg_name).then(unittest.expectAsync1(((api.Product response) { + res + .update(arg_request, arg_parent, arg_name) + .then(unittest.expectAsync1(((api.Product response) { checkProduct(response); }))); }); - }); - - } -