| Index: generated/googleapis/test/speech/v1_test.dart
|
| diff --git a/generated/googleapis/test/speech/v1_test.dart b/generated/googleapis/test/speech/v1_test.dart
|
| index dca3b85d954dbee62138916fdacafa05a33865ce..59372fbe79a4dce8dd6b8092e112c2c2b67b6c65 100644
|
| --- a/generated/googleapis/test/speech/v1_test.dart
|
| +++ b/generated/googleapis/test/speech/v1_test.dart
|
| @@ -1,12 +1,10 @@
|
| library googleapis.speech.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/speech/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--;
|
| }
|
|
|
| -buildUnnamed2707() {
|
| +buildUnnamed2700() {
|
| var o = new core.List<api.Operation>();
|
| o.add(buildOperation());
|
| o.add(buildOperation());
|
| return o;
|
| }
|
|
|
| -checkUnnamed2707(core.List<api.Operation> o) {
|
| +checkUnnamed2700(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 = buildUnnamed2707();
|
| + o.operations = buildUnnamed2700();
|
| }
|
| buildCounterListOperationsResponse--;
|
| return o;
|
| @@ -114,7 +109,7 @@ checkListOperationsResponse(api.ListOperationsResponse o) {
|
| buildCounterListOperationsResponse++;
|
| if (buildCounterListOperationsResponse < 3) {
|
| unittest.expect(o.nextPageToken, unittest.equals('foo'));
|
| - checkUnnamed2707(o.operations);
|
| + checkUnnamed2700(o.operations);
|
| }
|
| buildCounterListOperationsResponse--;
|
| }
|
| @@ -140,30 +135,62 @@ checkLongRunningRecognizeRequest(api.LongRunningRecognizeRequest o) {
|
| buildCounterLongRunningRecognizeRequest--;
|
| }
|
|
|
| -buildUnnamed2708() {
|
| +buildUnnamed2701() {
|
| 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;
|
| }
|
|
|
| -checkUnnamed2708(core.Map<core.String, core.Object> o) {
|
| +checkUnnamed2701(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'));
|
| -}
|
| -
|
| -buildUnnamed2709() {
|
| + 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'));
|
| +}
|
| +
|
| +buildUnnamed2702() {
|
| 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;
|
| }
|
|
|
| -checkUnnamed2709(core.Map<core.String, core.Object> o) {
|
| +checkUnnamed2702(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;
|
| @@ -173,9 +200,9 @@ buildOperation() {
|
| if (buildCounterOperation < 3) {
|
| o.done = true;
|
| o.error = buildStatus();
|
| - o.metadata = buildUnnamed2708();
|
| + o.metadata = buildUnnamed2701();
|
| o.name = "foo";
|
| - o.response = buildUnnamed2709();
|
| + o.response = buildUnnamed2702();
|
| }
|
| buildCounterOperation--;
|
| return o;
|
| @@ -186,9 +213,9 @@ checkOperation(api.Operation o) {
|
| if (buildCounterOperation < 3) {
|
| unittest.expect(o.done, unittest.isTrue);
|
| checkStatus(o.error);
|
| - checkUnnamed2708(o.metadata);
|
| + checkUnnamed2701(o.metadata);
|
| unittest.expect(o.name, unittest.equals('foo'));
|
| - checkUnnamed2709(o.response);
|
| + checkUnnamed2702(o.response);
|
| }
|
| buildCounterOperation--;
|
| }
|
| @@ -214,14 +241,14 @@ checkRecognitionAudio(api.RecognitionAudio o) {
|
| buildCounterRecognitionAudio--;
|
| }
|
|
|
| -buildUnnamed2710() {
|
| +buildUnnamed2703() {
|
| var o = new core.List<api.SpeechContext>();
|
| o.add(buildSpeechContext());
|
| o.add(buildSpeechContext());
|
| return o;
|
| }
|
|
|
| -checkUnnamed2710(core.List<api.SpeechContext> o) {
|
| +checkUnnamed2703(core.List<api.SpeechContext> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkSpeechContext(o[0]);
|
| checkSpeechContext(o[1]);
|
| @@ -238,7 +265,7 @@ buildRecognitionConfig() {
|
| o.maxAlternatives = 42;
|
| o.profanityFilter = true;
|
| o.sampleRateHertz = 42;
|
| - o.speechContexts = buildUnnamed2710();
|
| + o.speechContexts = buildUnnamed2703();
|
| }
|
| buildCounterRecognitionConfig--;
|
| return o;
|
| @@ -253,7 +280,7 @@ checkRecognitionConfig(api.RecognitionConfig o) {
|
| unittest.expect(o.maxAlternatives, unittest.equals(42));
|
| unittest.expect(o.profanityFilter, unittest.isTrue);
|
| unittest.expect(o.sampleRateHertz, unittest.equals(42));
|
| - checkUnnamed2710(o.speechContexts);
|
| + checkUnnamed2703(o.speechContexts);
|
| }
|
| buildCounterRecognitionConfig--;
|
| }
|
| @@ -279,14 +306,14 @@ checkRecognizeRequest(api.RecognizeRequest o) {
|
| buildCounterRecognizeRequest--;
|
| }
|
|
|
| -buildUnnamed2711() {
|
| +buildUnnamed2704() {
|
| var o = new core.List<api.SpeechRecognitionResult>();
|
| o.add(buildSpeechRecognitionResult());
|
| o.add(buildSpeechRecognitionResult());
|
| return o;
|
| }
|
|
|
| -checkUnnamed2711(core.List<api.SpeechRecognitionResult> o) {
|
| +checkUnnamed2704(core.List<api.SpeechRecognitionResult> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkSpeechRecognitionResult(o[0]);
|
| checkSpeechRecognitionResult(o[1]);
|
| @@ -297,7 +324,7 @@ buildRecognizeResponse() {
|
| var o = new api.RecognizeResponse();
|
| buildCounterRecognizeResponse++;
|
| if (buildCounterRecognizeResponse < 3) {
|
| - o.results = buildUnnamed2711();
|
| + o.results = buildUnnamed2704();
|
| }
|
| buildCounterRecognizeResponse--;
|
| return o;
|
| @@ -306,19 +333,19 @@ buildRecognizeResponse() {
|
| checkRecognizeResponse(api.RecognizeResponse o) {
|
| buildCounterRecognizeResponse++;
|
| if (buildCounterRecognizeResponse < 3) {
|
| - checkUnnamed2711(o.results);
|
| + checkUnnamed2704(o.results);
|
| }
|
| buildCounterRecognizeResponse--;
|
| }
|
|
|
| -buildUnnamed2712() {
|
| +buildUnnamed2705() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed2712(core.List<core.String> o) {
|
| +checkUnnamed2705(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'));
|
| @@ -329,7 +356,7 @@ buildSpeechContext() {
|
| var o = new api.SpeechContext();
|
| buildCounterSpeechContext++;
|
| if (buildCounterSpeechContext < 3) {
|
| - o.phrases = buildUnnamed2712();
|
| + o.phrases = buildUnnamed2705();
|
| }
|
| buildCounterSpeechContext--;
|
| return o;
|
| @@ -338,19 +365,19 @@ buildSpeechContext() {
|
| checkSpeechContext(api.SpeechContext o) {
|
| buildCounterSpeechContext++;
|
| if (buildCounterSpeechContext < 3) {
|
| - checkUnnamed2712(o.phrases);
|
| + checkUnnamed2705(o.phrases);
|
| }
|
| buildCounterSpeechContext--;
|
| }
|
|
|
| -buildUnnamed2713() {
|
| +buildUnnamed2706() {
|
| var o = new core.List<api.WordInfo>();
|
| o.add(buildWordInfo());
|
| o.add(buildWordInfo());
|
| return o;
|
| }
|
|
|
| -checkUnnamed2713(core.List<api.WordInfo> o) {
|
| +checkUnnamed2706(core.List<api.WordInfo> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkWordInfo(o[0]);
|
| checkWordInfo(o[1]);
|
| @@ -363,7 +390,7 @@ buildSpeechRecognitionAlternative() {
|
| if (buildCounterSpeechRecognitionAlternative < 3) {
|
| o.confidence = 42.0;
|
| o.transcript = "foo";
|
| - o.words = buildUnnamed2713();
|
| + o.words = buildUnnamed2706();
|
| }
|
| buildCounterSpeechRecognitionAlternative--;
|
| return o;
|
| @@ -374,19 +401,19 @@ checkSpeechRecognitionAlternative(api.SpeechRecognitionAlternative o) {
|
| if (buildCounterSpeechRecognitionAlternative < 3) {
|
| unittest.expect(o.confidence, unittest.equals(42.0));
|
| unittest.expect(o.transcript, unittest.equals('foo'));
|
| - checkUnnamed2713(o.words);
|
| + checkUnnamed2706(o.words);
|
| }
|
| buildCounterSpeechRecognitionAlternative--;
|
| }
|
|
|
| -buildUnnamed2714() {
|
| +buildUnnamed2707() {
|
| var o = new core.List<api.SpeechRecognitionAlternative>();
|
| o.add(buildSpeechRecognitionAlternative());
|
| o.add(buildSpeechRecognitionAlternative());
|
| return o;
|
| }
|
|
|
| -checkUnnamed2714(core.List<api.SpeechRecognitionAlternative> o) {
|
| +checkUnnamed2707(core.List<api.SpeechRecognitionAlternative> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkSpeechRecognitionAlternative(o[0]);
|
| checkSpeechRecognitionAlternative(o[1]);
|
| @@ -397,7 +424,7 @@ buildSpeechRecognitionResult() {
|
| var o = new api.SpeechRecognitionResult();
|
| buildCounterSpeechRecognitionResult++;
|
| if (buildCounterSpeechRecognitionResult < 3) {
|
| - o.alternatives = buildUnnamed2714();
|
| + o.alternatives = buildUnnamed2707();
|
| }
|
| buildCounterSpeechRecognitionResult--;
|
| return o;
|
| @@ -406,35 +433,51 @@ buildSpeechRecognitionResult() {
|
| checkSpeechRecognitionResult(api.SpeechRecognitionResult o) {
|
| buildCounterSpeechRecognitionResult++;
|
| if (buildCounterSpeechRecognitionResult < 3) {
|
| - checkUnnamed2714(o.alternatives);
|
| + checkUnnamed2707(o.alternatives);
|
| }
|
| buildCounterSpeechRecognitionResult--;
|
| }
|
|
|
| -buildUnnamed2715() {
|
| +buildUnnamed2708() {
|
| 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;
|
| }
|
|
|
| -checkUnnamed2715(core.Map<core.String, core.Object> o) {
|
| +checkUnnamed2708(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'));
|
| }
|
|
|
| -buildUnnamed2716() {
|
| +buildUnnamed2709() {
|
| var o = new core.List<core.Map<core.String, core.Object>>();
|
| - o.add(buildUnnamed2715());
|
| - o.add(buildUnnamed2715());
|
| + o.add(buildUnnamed2708());
|
| + o.add(buildUnnamed2708());
|
| return o;
|
| }
|
|
|
| -checkUnnamed2716(core.List<core.Map<core.String, core.Object>> o) {
|
| +checkUnnamed2709(core.List<core.Map<core.String, core.Object>> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| - checkUnnamed2715(o[0]);
|
| - checkUnnamed2715(o[1]);
|
| + checkUnnamed2708(o[0]);
|
| + checkUnnamed2708(o[1]);
|
| }
|
|
|
| core.int buildCounterStatus = 0;
|
| @@ -443,7 +486,7 @@ buildStatus() {
|
| buildCounterStatus++;
|
| if (buildCounterStatus < 3) {
|
| o.code = 42;
|
| - o.details = buildUnnamed2716();
|
| + o.details = buildUnnamed2709();
|
| o.message = "foo";
|
| }
|
| buildCounterStatus--;
|
| @@ -454,7 +497,7 @@ checkStatus(api.Status o) {
|
| buildCounterStatus++;
|
| if (buildCounterStatus < 3) {
|
| unittest.expect(o.code, unittest.equals(42));
|
| - checkUnnamed2716(o.details);
|
| + checkUnnamed2709(o.details);
|
| unittest.expect(o.message, unittest.equals('foo'));
|
| }
|
| buildCounterStatus--;
|
| @@ -483,7 +526,6 @@ checkWordInfo(api.WordInfo o) {
|
| buildCounterWordInfo--;
|
| }
|
|
|
| -
|
| main() {
|
| unittest.group("obj-schema-CancelOperationRequest", () {
|
| unittest.test("to-json--from-json", () {
|
| @@ -493,7 +535,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-Empty", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildEmpty();
|
| @@ -502,7 +543,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-ListOperationsResponse", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildListOperationsResponse();
|
| @@ -511,7 +551,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-LongRunningRecognizeRequest", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildLongRunningRecognizeRequest();
|
| @@ -520,7 +559,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-Operation", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildOperation();
|
| @@ -529,7 +567,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-RecognitionAudio", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildRecognitionAudio();
|
| @@ -538,7 +575,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-RecognitionConfig", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildRecognitionConfig();
|
| @@ -547,7 +583,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-RecognizeRequest", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildRecognizeRequest();
|
| @@ -556,7 +591,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-RecognizeResponse", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildRecognizeResponse();
|
| @@ -565,7 +599,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SpeechContext", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSpeechContext();
|
| @@ -574,7 +607,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SpeechRecognitionAlternative", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSpeechRecognitionAlternative();
|
| @@ -583,7 +615,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-SpeechRecognitionResult", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildSpeechRecognitionResult();
|
| @@ -592,7 +623,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-Status", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildStatus();
|
| @@ -601,7 +631,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-WordInfo", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildWordInfo();
|
| @@ -610,10 +639,8 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("resource-OperationsResourceApi", () {
|
| unittest.test("method--cancel", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.OperationsResourceApi res = new api.SpeechApi(mock).operations;
|
| var arg_request = buildCancelOperationRequest();
|
| @@ -626,9 +653,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 + 14), unittest.equals("v1/operations/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 14),
|
| + unittest.equals("v1/operations/"));
|
| pathOffset += 14;
|
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
|
|
|
| @@ -642,27 +671,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.SpeechApi(mock).operations;
|
| var arg_name = "foo";
|
| @@ -671,9 +702,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 + 14), unittest.equals("v1/operations/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 14),
|
| + unittest.equals("v1/operations/"));
|
| pathOffset += 14;
|
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
|
|
|
| @@ -687,16 +720,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));
|
| @@ -707,7 +741,6 @@ main() {
|
| });
|
|
|
| unittest.test("method--get", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.OperationsResourceApi res = new api.SpeechApi(mock).operations;
|
| var arg_name = "foo";
|
| @@ -716,9 +749,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 + 14), unittest.equals("v1/operations/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 14),
|
| + unittest.equals("v1/operations/"));
|
| pathOffset += 14;
|
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
|
|
|
| @@ -732,16 +767,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));
|
| @@ -752,7 +788,6 @@ main() {
|
| });
|
|
|
| unittest.test("method--list", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.OperationsResourceApi res = new api.SpeechApi(mock).operations;
|
| var arg_filter = "foo";
|
| @@ -764,9 +799,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 + 13), unittest.equals("v1/operations"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 13),
|
| + unittest.equals("v1/operations"));
|
| pathOffset += 13;
|
|
|
| var query = (req.url).query;
|
| @@ -779,35 +816,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["filter"].first, unittest.equals(arg_filter));
|
| - unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken));
|
| + 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(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(filter: arg_filter, pageToken: arg_pageToken, name: arg_name, pageSize: arg_pageSize).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--longrunningrecognize", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.SpeechResourceApi res = new api.SpeechApi(mock).speech;
|
| var arg_request = buildLongRunningRecognizeRequest();
|
| @@ -819,9 +862,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 + 30), unittest.equals("v1/speech:longrunningrecognize"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 30),
|
| + unittest.equals("v1/speech:longrunningrecognize"));
|
| pathOffset += 30;
|
|
|
| var query = (req.url).query;
|
| @@ -834,27 +879,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.longrunningrecognize(arg_request).then(unittest.expectAsync1(((api.Operation response) {
|
| + res
|
| + .longrunningrecognize(arg_request)
|
| + .then(unittest.expectAsync1(((api.Operation response) {
|
| checkOperation(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--recognize", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.SpeechResourceApi res = new api.SpeechApi(mock).speech;
|
| var arg_request = buildRecognizeRequest();
|
| @@ -866,9 +913,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("v1/speech:recognize"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("v1/speech:recognize"));
|
| pathOffset += 19;
|
|
|
| var query = (req.url).query;
|
| @@ -881,27 +930,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(buildRecognizeResponse());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.recognize(arg_request).then(unittest.expectAsync1(((api.RecognizeResponse response) {
|
| + res
|
| + .recognize(arg_request)
|
| + .then(unittest.expectAsync1(((api.RecognizeResponse response) {
|
| checkRecognizeResponse(response);
|
| })));
|
| });
|
| -
|
| });
|
| -
|
| -
|
| }
|
| -
|
|
|