| Index: generated/googleapis_beta/test/speech/v1beta1_test.dart
|
| diff --git a/generated/googleapis_beta/test/speech/v1beta1_test.dart b/generated/googleapis_beta/test/speech/v1beta1_test.dart
|
| index bd9d662127c6b345fea0b698b5a5a15b3fe185fe..9da653ceb88a9c8ec4346daaee26fbb4db9569a5 100644
|
| --- a/generated/googleapis_beta/test/speech/v1beta1_test.dart
|
| +++ b/generated/googleapis_beta/test/speech/v1beta1_test.dart
|
| @@ -1,12 +1,10 @@
|
| library googleapis_beta.speech.v1beta1.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_beta/speech/v1beta1.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);
|
| }
|
| @@ -76,27 +75,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--;
|
| }
|
|
|
| -buildUnnamed3416() {
|
| +buildUnnamed3421() {
|
| var o = new core.List<api.Operation>();
|
| o.add(buildOperation());
|
| o.add(buildOperation());
|
| return o;
|
| }
|
|
|
| -checkUnnamed3416(core.List<api.Operation> o) {
|
| +checkUnnamed3421(core.List<api.Operation> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkOperation(o[0]);
|
| checkOperation(o[1]);
|
| @@ -108,7 +105,7 @@ buildListOperationsResponse() {
|
| buildCounterListOperationsResponse++;
|
| if (buildCounterListOperationsResponse < 3) {
|
| o.nextPageToken = "foo";
|
| - o.operations = buildUnnamed3416();
|
| + o.operations = buildUnnamed3421();
|
| }
|
| buildCounterListOperationsResponse--;
|
| return o;
|
| @@ -118,35 +115,67 @@ checkListOperationsResponse(api.ListOperationsResponse o) {
|
| buildCounterListOperationsResponse++;
|
| if (buildCounterListOperationsResponse < 3) {
|
| unittest.expect(o.nextPageToken, unittest.equals('foo'));
|
| - checkUnnamed3416(o.operations);
|
| + checkUnnamed3421(o.operations);
|
| }
|
| buildCounterListOperationsResponse--;
|
| }
|
|
|
| -buildUnnamed3417() {
|
| +buildUnnamed3422() {
|
| 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;
|
| }
|
|
|
| -checkUnnamed3417(core.Map<core.String, core.Object> o) {
|
| +checkUnnamed3422(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'));
|
| }
|
|
|
| -buildUnnamed3418() {
|
| +buildUnnamed3423() {
|
| 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;
|
| }
|
|
|
| -checkUnnamed3418(core.Map<core.String, core.Object> o) {
|
| +checkUnnamed3423(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;
|
| @@ -156,9 +185,9 @@ buildOperation() {
|
| if (buildCounterOperation < 3) {
|
| o.done = true;
|
| o.error = buildStatus();
|
| - o.metadata = buildUnnamed3417();
|
| + o.metadata = buildUnnamed3422();
|
| o.name = "foo";
|
| - o.response = buildUnnamed3418();
|
| + o.response = buildUnnamed3423();
|
| }
|
| buildCounterOperation--;
|
| return o;
|
| @@ -169,9 +198,9 @@ checkOperation(api.Operation o) {
|
| if (buildCounterOperation < 3) {
|
| unittest.expect(o.done, unittest.isTrue);
|
| checkStatus(o.error);
|
| - checkUnnamed3417(o.metadata);
|
| + checkUnnamed3422(o.metadata);
|
| unittest.expect(o.name, unittest.equals('foo'));
|
| - checkUnnamed3418(o.response);
|
| + checkUnnamed3423(o.response);
|
| }
|
| buildCounterOperation--;
|
| }
|
| @@ -226,14 +255,14 @@ checkRecognitionConfig(api.RecognitionConfig o) {
|
| buildCounterRecognitionConfig--;
|
| }
|
|
|
| -buildUnnamed3419() {
|
| +buildUnnamed3424() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed3419(core.List<core.String> o) {
|
| +checkUnnamed3424(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'));
|
| @@ -244,7 +273,7 @@ buildSpeechContext() {
|
| var o = new api.SpeechContext();
|
| buildCounterSpeechContext++;
|
| if (buildCounterSpeechContext < 3) {
|
| - o.phrases = buildUnnamed3419();
|
| + o.phrases = buildUnnamed3424();
|
| }
|
| buildCounterSpeechContext--;
|
| return o;
|
| @@ -253,7 +282,7 @@ buildSpeechContext() {
|
| checkSpeechContext(api.SpeechContext o) {
|
| buildCounterSpeechContext++;
|
| if (buildCounterSpeechContext < 3) {
|
| - checkUnnamed3419(o.phrases);
|
| + checkUnnamed3424(o.phrases);
|
| }
|
| buildCounterSpeechContext--;
|
| }
|
| @@ -279,14 +308,14 @@ checkSpeechRecognitionAlternative(api.SpeechRecognitionAlternative o) {
|
| buildCounterSpeechRecognitionAlternative--;
|
| }
|
|
|
| -buildUnnamed3420() {
|
| +buildUnnamed3425() {
|
| var o = new core.List<api.SpeechRecognitionAlternative>();
|
| o.add(buildSpeechRecognitionAlternative());
|
| o.add(buildSpeechRecognitionAlternative());
|
| return o;
|
| }
|
|
|
| -checkUnnamed3420(core.List<api.SpeechRecognitionAlternative> o) {
|
| +checkUnnamed3425(core.List<api.SpeechRecognitionAlternative> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkSpeechRecognitionAlternative(o[0]);
|
| checkSpeechRecognitionAlternative(o[1]);
|
| @@ -297,7 +326,7 @@ buildSpeechRecognitionResult() {
|
| var o = new api.SpeechRecognitionResult();
|
| buildCounterSpeechRecognitionResult++;
|
| if (buildCounterSpeechRecognitionResult < 3) {
|
| - o.alternatives = buildUnnamed3420();
|
| + o.alternatives = buildUnnamed3425();
|
| }
|
| buildCounterSpeechRecognitionResult--;
|
| return o;
|
| @@ -306,35 +335,51 @@ buildSpeechRecognitionResult() {
|
| checkSpeechRecognitionResult(api.SpeechRecognitionResult o) {
|
| buildCounterSpeechRecognitionResult++;
|
| if (buildCounterSpeechRecognitionResult < 3) {
|
| - checkUnnamed3420(o.alternatives);
|
| + checkUnnamed3425(o.alternatives);
|
| }
|
| buildCounterSpeechRecognitionResult--;
|
| }
|
|
|
| -buildUnnamed3421() {
|
| +buildUnnamed3426() {
|
| 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;
|
| }
|
|
|
| -checkUnnamed3421(core.Map<core.String, core.Object> o) {
|
| +checkUnnamed3426(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'));
|
| -}
|
| -
|
| -buildUnnamed3422() {
|
| + 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'));
|
| +}
|
| +
|
| +buildUnnamed3427() {
|
| var o = new core.List<core.Map<core.String, core.Object>>();
|
| - o.add(buildUnnamed3421());
|
| - o.add(buildUnnamed3421());
|
| + o.add(buildUnnamed3426());
|
| + o.add(buildUnnamed3426());
|
| return o;
|
| }
|
|
|
| -checkUnnamed3422(core.List<core.Map<core.String, core.Object>> o) {
|
| +checkUnnamed3427(core.List<core.Map<core.String, core.Object>> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| - checkUnnamed3421(o[0]);
|
| - checkUnnamed3421(o[1]);
|
| + checkUnnamed3426(o[0]);
|
| + checkUnnamed3426(o[1]);
|
| }
|
|
|
| core.int buildCounterStatus = 0;
|
| @@ -343,7 +388,7 @@ buildStatus() {
|
| buildCounterStatus++;
|
| if (buildCounterStatus < 3) {
|
| o.code = 42;
|
| - o.details = buildUnnamed3422();
|
| + o.details = buildUnnamed3427();
|
| o.message = "foo";
|
| }
|
| buildCounterStatus--;
|
| @@ -354,7 +399,7 @@ checkStatus(api.Status o) {
|
| buildCounterStatus++;
|
| if (buildCounterStatus < 3) {
|
| unittest.expect(o.code, unittest.equals(42));
|
| - checkUnnamed3422(o.details);
|
| + checkUnnamed3427(o.details);
|
| unittest.expect(o.message, unittest.equals('foo'));
|
| }
|
| buildCounterStatus--;
|
| @@ -381,14 +426,14 @@ checkSyncRecognizeRequest(api.SyncRecognizeRequest o) {
|
| buildCounterSyncRecognizeRequest--;
|
| }
|
|
|
| -buildUnnamed3423() {
|
| +buildUnnamed3428() {
|
| var o = new core.List<api.SpeechRecognitionResult>();
|
| o.add(buildSpeechRecognitionResult());
|
| o.add(buildSpeechRecognitionResult());
|
| return o;
|
| }
|
|
|
| -checkUnnamed3423(core.List<api.SpeechRecognitionResult> o) {
|
| +checkUnnamed3428(core.List<api.SpeechRecognitionResult> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkSpeechRecognitionResult(o[0]);
|
| checkSpeechRecognitionResult(o[1]);
|
| @@ -399,7 +444,7 @@ buildSyncRecognizeResponse() {
|
| var o = new api.SyncRecognizeResponse();
|
| buildCounterSyncRecognizeResponse++;
|
| if (buildCounterSyncRecognizeResponse < 3) {
|
| - o.results = buildUnnamed3423();
|
| + o.results = buildUnnamed3428();
|
| }
|
| buildCounterSyncRecognizeResponse--;
|
| return o;
|
| @@ -408,12 +453,11 @@ buildSyncRecognizeResponse() {
|
| checkSyncRecognizeResponse(api.SyncRecognizeResponse o) {
|
| buildCounterSyncRecognizeResponse++;
|
| if (buildCounterSyncRecognizeResponse < 3) {
|
| - checkUnnamed3423(o.results);
|
| + checkUnnamed3428(o.results);
|
| }
|
| buildCounterSyncRecognizeResponse--;
|
| }
|
|
|
| -
|
| main() {
|
| unittest.group("obj-schema-AsyncRecognizeRequest", () {
|
| unittest.test("to-json--from-json", () {
|
| @@ -423,7 +467,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-Empty", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildEmpty();
|
| @@ -432,7 +475,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-ListOperationsResponse", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildListOperationsResponse();
|
| @@ -441,7 +483,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-Operation", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildOperation();
|
| @@ -450,7 +491,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-RecognitionAudio", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildRecognitionAudio();
|
| @@ -459,7 +499,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-RecognitionConfig", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildRecognitionConfig();
|
| @@ -468,7 +507,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SpeechContext", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSpeechContext();
|
| @@ -477,7 +515,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SpeechRecognitionAlternative", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSpeechRecognitionAlternative();
|
| @@ -486,7 +523,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SpeechRecognitionResult", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSpeechRecognitionResult();
|
| @@ -495,7 +531,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-Status", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildStatus();
|
| @@ -504,7 +539,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SyncRecognizeRequest", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSyncRecognizeRequest();
|
| @@ -513,7 +547,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SyncRecognizeResponse", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSyncRecognizeResponse();
|
| @@ -522,10 +555,8 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("resource-OperationsResourceApi", () {
|
| unittest.test("method--cancel", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.OperationsResourceApi res = new api.SpeechApi(mock).operations;
|
| var arg_name = "foo";
|
| @@ -534,9 +565,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 + 19), unittest.equals("v1beta1/operations/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("v1beta1/operations/"));
|
| pathOffset += 19;
|
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
|
|
|
| @@ -550,16 +583,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));
|
| @@ -570,7 +604,6 @@ main() {
|
| });
|
|
|
| unittest.test("method--delete", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.OperationsResourceApi res = new api.SpeechApi(mock).operations;
|
| var arg_name = "foo";
|
| @@ -579,9 +612,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 + 19), unittest.equals("v1beta1/operations/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("v1beta1/operations/"));
|
| pathOffset += 19;
|
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
|
|
|
| @@ -595,16 +630,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));
|
| @@ -615,7 +651,6 @@ main() {
|
| });
|
|
|
| unittest.test("method--get", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.OperationsResourceApi res = new api.SpeechApi(mock).operations;
|
| var arg_name = "foo";
|
| @@ -624,9 +659,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 + 19), unittest.equals("v1beta1/operations/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("v1beta1/operations/"));
|
| pathOffset += 19;
|
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
|
|
|
| @@ -640,16 +677,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(buildOperation());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| @@ -660,21 +698,22 @@ main() {
|
| });
|
|
|
| unittest.test("method--list", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.OperationsResourceApi res = new api.SpeechApi(mock).operations;
|
| + var arg_filter = "foo";
|
| var arg_pageToken = "foo";
|
| var arg_name = "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 + 18), unittest.equals("v1beta1/operations"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 18),
|
| + unittest.equals("v1beta1/operations"));
|
| pathOffset += 18;
|
|
|
| var query = (req.url).query;
|
| @@ -687,35 +726,41 @@ 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(queryMap["name"].first, unittest.equals(arg_name));
|
| - 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(queryMap["name"].first, unittest.equals(arg_name));
|
| + 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(pageToken: arg_pageToken, name: arg_name, pageSize: arg_pageSize, filter: arg_filter).then(unittest.expectAsync1(((api.ListOperationsResponse response) {
|
| + res
|
| + .list(
|
| + filter: arg_filter,
|
| + pageToken: arg_pageToken,
|
| + name: arg_name,
|
| + pageSize: arg_pageSize)
|
| + .then(unittest.expectAsync1(((api.ListOperationsResponse response) {
|
| checkListOperationsResponse(response);
|
| })));
|
| });
|
| -
|
| });
|
|
|
| -
|
| unittest.group("resource-SpeechResourceApi", () {
|
| unittest.test("method--asyncrecognize", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.SpeechResourceApi res = new api.SpeechApi(mock).speech;
|
| var arg_request = buildAsyncRecognizeRequest();
|
| @@ -727,9 +772,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 + 29), unittest.equals("v1beta1/speech:asyncrecognize"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 29),
|
| + unittest.equals("v1beta1/speech:asyncrecognize"));
|
| pathOffset += 29;
|
|
|
| var query = (req.url).query;
|
| @@ -742,27 +789,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(buildOperation());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.asyncrecognize(arg_request).then(unittest.expectAsync1(((api.Operation response) {
|
| + res
|
| + .asyncrecognize(arg_request)
|
| + .then(unittest.expectAsync1(((api.Operation response) {
|
| checkOperation(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--syncrecognize", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.SpeechResourceApi res = new api.SpeechApi(mock).speech;
|
| var arg_request = buildSyncRecognizeRequest();
|
| @@ -774,9 +823,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 + 28), unittest.equals("v1beta1/speech:syncrecognize"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 28),
|
| + unittest.equals("v1beta1/speech:syncrecognize"));
|
| pathOffset += 28;
|
|
|
| var query = (req.url).query;
|
| @@ -789,27 +840,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(buildSyncRecognizeResponse());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.syncrecognize(arg_request).then(unittest.expectAsync1(((api.SyncRecognizeResponse response) {
|
| + res
|
| + .syncrecognize(arg_request)
|
| + .then(unittest.expectAsync1(((api.SyncRecognizeResponse response) {
|
| checkSyncRecognizeResponse(response);
|
| })));
|
| });
|
| -
|
| });
|
| -
|
| -
|
| }
|
| -
|
|
|