| Index: generated/googleapis/test/pubsub/v1_test.dart
|
| diff --git a/generated/googleapis/test/pubsub/v1_test.dart b/generated/googleapis/test/pubsub/v1_test.dart
|
| index ffcde498a672de6c28c10da73a3a3fb17b22dcf6..357842c1900c21cef772667e252d94fd6a9a658c 100644
|
| --- a/generated/googleapis/test/pubsub/v1_test.dart
|
| +++ b/generated/googleapis/test/pubsub/v1_test.dart
|
| @@ -51,14 +51,14 @@ http.StreamedResponse stringResponse(
|
| return new http.StreamedResponse(stream, status, headers: headers);
|
| }
|
|
|
| -buildUnnamed1340() {
|
| +buildUnnamed1362() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed1340(core.List<core.String> o) {
|
| +checkUnnamed1362(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'));
|
| @@ -69,7 +69,7 @@ buildAcknowledgeRequest() {
|
| var o = new api.AcknowledgeRequest();
|
| buildCounterAcknowledgeRequest++;
|
| if (buildCounterAcknowledgeRequest < 3) {
|
| - o.ackIds = buildUnnamed1340();
|
| + o.ackIds = buildUnnamed1362();
|
| }
|
| buildCounterAcknowledgeRequest--;
|
| return o;
|
| @@ -78,19 +78,19 @@ buildAcknowledgeRequest() {
|
| checkAcknowledgeRequest(api.AcknowledgeRequest o) {
|
| buildCounterAcknowledgeRequest++;
|
| if (buildCounterAcknowledgeRequest < 3) {
|
| - checkUnnamed1340(o.ackIds);
|
| + checkUnnamed1362(o.ackIds);
|
| }
|
| buildCounterAcknowledgeRequest--;
|
| }
|
|
|
| -buildUnnamed1341() {
|
| +buildUnnamed1363() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed1341(core.List<core.String> o) {
|
| +checkUnnamed1363(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'));
|
| @@ -101,7 +101,7 @@ buildBinding() {
|
| var o = new api.Binding();
|
| buildCounterBinding++;
|
| if (buildCounterBinding < 3) {
|
| - o.members = buildUnnamed1341();
|
| + o.members = buildUnnamed1363();
|
| o.role = "foo";
|
| }
|
| buildCounterBinding--;
|
| @@ -111,7 +111,7 @@ buildBinding() {
|
| checkBinding(api.Binding o) {
|
| buildCounterBinding++;
|
| if (buildCounterBinding < 3) {
|
| - checkUnnamed1341(o.members);
|
| + checkUnnamed1363(o.members);
|
| unittest.expect(o.role, unittest.equals('foo'));
|
| }
|
| buildCounterBinding--;
|
| @@ -134,14 +134,14 @@ checkEmpty(api.Empty o) {
|
| buildCounterEmpty--;
|
| }
|
|
|
| -buildUnnamed1342() {
|
| +buildUnnamed1364() {
|
| var o = new core.List<api.Subscription>();
|
| o.add(buildSubscription());
|
| o.add(buildSubscription());
|
| return o;
|
| }
|
|
|
| -checkUnnamed1342(core.List<api.Subscription> o) {
|
| +checkUnnamed1364(core.List<api.Subscription> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkSubscription(o[0]);
|
| checkSubscription(o[1]);
|
| @@ -153,7 +153,7 @@ buildListSubscriptionsResponse() {
|
| buildCounterListSubscriptionsResponse++;
|
| if (buildCounterListSubscriptionsResponse < 3) {
|
| o.nextPageToken = "foo";
|
| - o.subscriptions = buildUnnamed1342();
|
| + o.subscriptions = buildUnnamed1364();
|
| }
|
| buildCounterListSubscriptionsResponse--;
|
| return o;
|
| @@ -163,19 +163,19 @@ checkListSubscriptionsResponse(api.ListSubscriptionsResponse o) {
|
| buildCounterListSubscriptionsResponse++;
|
| if (buildCounterListSubscriptionsResponse < 3) {
|
| unittest.expect(o.nextPageToken, unittest.equals('foo'));
|
| - checkUnnamed1342(o.subscriptions);
|
| + checkUnnamed1364(o.subscriptions);
|
| }
|
| buildCounterListSubscriptionsResponse--;
|
| }
|
|
|
| -buildUnnamed1343() {
|
| +buildUnnamed1365() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed1343(core.List<core.String> o) {
|
| +checkUnnamed1365(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'));
|
| @@ -187,7 +187,7 @@ buildListTopicSubscriptionsResponse() {
|
| buildCounterListTopicSubscriptionsResponse++;
|
| if (buildCounterListTopicSubscriptionsResponse < 3) {
|
| o.nextPageToken = "foo";
|
| - o.subscriptions = buildUnnamed1343();
|
| + o.subscriptions = buildUnnamed1365();
|
| }
|
| buildCounterListTopicSubscriptionsResponse--;
|
| return o;
|
| @@ -197,19 +197,19 @@ checkListTopicSubscriptionsResponse(api.ListTopicSubscriptionsResponse o) {
|
| buildCounterListTopicSubscriptionsResponse++;
|
| if (buildCounterListTopicSubscriptionsResponse < 3) {
|
| unittest.expect(o.nextPageToken, unittest.equals('foo'));
|
| - checkUnnamed1343(o.subscriptions);
|
| + checkUnnamed1365(o.subscriptions);
|
| }
|
| buildCounterListTopicSubscriptionsResponse--;
|
| }
|
|
|
| -buildUnnamed1344() {
|
| +buildUnnamed1366() {
|
| var o = new core.List<api.Topic>();
|
| o.add(buildTopic());
|
| o.add(buildTopic());
|
| return o;
|
| }
|
|
|
| -checkUnnamed1344(core.List<api.Topic> o) {
|
| +checkUnnamed1366(core.List<api.Topic> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkTopic(o[0]);
|
| checkTopic(o[1]);
|
| @@ -221,7 +221,7 @@ buildListTopicsResponse() {
|
| buildCounterListTopicsResponse++;
|
| if (buildCounterListTopicsResponse < 3) {
|
| o.nextPageToken = "foo";
|
| - o.topics = buildUnnamed1344();
|
| + o.topics = buildUnnamed1366();
|
| }
|
| buildCounterListTopicsResponse--;
|
| return o;
|
| @@ -231,19 +231,19 @@ checkListTopicsResponse(api.ListTopicsResponse o) {
|
| buildCounterListTopicsResponse++;
|
| if (buildCounterListTopicsResponse < 3) {
|
| unittest.expect(o.nextPageToken, unittest.equals('foo'));
|
| - checkUnnamed1344(o.topics);
|
| + checkUnnamed1366(o.topics);
|
| }
|
| buildCounterListTopicsResponse--;
|
| }
|
|
|
| -buildUnnamed1345() {
|
| +buildUnnamed1367() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed1345(core.List<core.String> o) {
|
| +checkUnnamed1367(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'));
|
| @@ -255,7 +255,7 @@ buildModifyAckDeadlineRequest() {
|
| buildCounterModifyAckDeadlineRequest++;
|
| if (buildCounterModifyAckDeadlineRequest < 3) {
|
| o.ackDeadlineSeconds = 42;
|
| - o.ackIds = buildUnnamed1345();
|
| + o.ackIds = buildUnnamed1367();
|
| }
|
| buildCounterModifyAckDeadlineRequest--;
|
| return o;
|
| @@ -265,7 +265,7 @@ checkModifyAckDeadlineRequest(api.ModifyAckDeadlineRequest o) {
|
| buildCounterModifyAckDeadlineRequest++;
|
| if (buildCounterModifyAckDeadlineRequest < 3) {
|
| unittest.expect(o.ackDeadlineSeconds, unittest.equals(42));
|
| - checkUnnamed1345(o.ackIds);
|
| + checkUnnamed1367(o.ackIds);
|
| }
|
| buildCounterModifyAckDeadlineRequest--;
|
| }
|
| @@ -289,14 +289,14 @@ checkModifyPushConfigRequest(api.ModifyPushConfigRequest o) {
|
| buildCounterModifyPushConfigRequest--;
|
| }
|
|
|
| -buildUnnamed1346() {
|
| +buildUnnamed1368() {
|
| var o = new core.List<api.Binding>();
|
| o.add(buildBinding());
|
| o.add(buildBinding());
|
| return o;
|
| }
|
|
|
| -checkUnnamed1346(core.List<api.Binding> o) {
|
| +checkUnnamed1368(core.List<api.Binding> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkBinding(o[0]);
|
| checkBinding(o[1]);
|
| @@ -307,7 +307,7 @@ buildPolicy() {
|
| var o = new api.Policy();
|
| buildCounterPolicy++;
|
| if (buildCounterPolicy < 3) {
|
| - o.bindings = buildUnnamed1346();
|
| + o.bindings = buildUnnamed1368();
|
| o.etag = "foo";
|
| o.version = 42;
|
| }
|
| @@ -318,21 +318,21 @@ buildPolicy() {
|
| checkPolicy(api.Policy o) {
|
| buildCounterPolicy++;
|
| if (buildCounterPolicy < 3) {
|
| - checkUnnamed1346(o.bindings);
|
| + checkUnnamed1368(o.bindings);
|
| unittest.expect(o.etag, unittest.equals('foo'));
|
| unittest.expect(o.version, unittest.equals(42));
|
| }
|
| buildCounterPolicy--;
|
| }
|
|
|
| -buildUnnamed1347() {
|
| +buildUnnamed1369() {
|
| var o = new core.List<api.PubsubMessage>();
|
| o.add(buildPubsubMessage());
|
| o.add(buildPubsubMessage());
|
| return o;
|
| }
|
|
|
| -checkUnnamed1347(core.List<api.PubsubMessage> o) {
|
| +checkUnnamed1369(core.List<api.PubsubMessage> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkPubsubMessage(o[0]);
|
| checkPubsubMessage(o[1]);
|
| @@ -343,7 +343,7 @@ buildPublishRequest() {
|
| var o = new api.PublishRequest();
|
| buildCounterPublishRequest++;
|
| if (buildCounterPublishRequest < 3) {
|
| - o.messages = buildUnnamed1347();
|
| + o.messages = buildUnnamed1369();
|
| }
|
| buildCounterPublishRequest--;
|
| return o;
|
| @@ -352,19 +352,19 @@ buildPublishRequest() {
|
| checkPublishRequest(api.PublishRequest o) {
|
| buildCounterPublishRequest++;
|
| if (buildCounterPublishRequest < 3) {
|
| - checkUnnamed1347(o.messages);
|
| + checkUnnamed1369(o.messages);
|
| }
|
| buildCounterPublishRequest--;
|
| }
|
|
|
| -buildUnnamed1348() {
|
| +buildUnnamed1370() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed1348(core.List<core.String> o) {
|
| +checkUnnamed1370(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'));
|
| @@ -375,7 +375,7 @@ buildPublishResponse() {
|
| var o = new api.PublishResponse();
|
| buildCounterPublishResponse++;
|
| if (buildCounterPublishResponse < 3) {
|
| - o.messageIds = buildUnnamed1348();
|
| + o.messageIds = buildUnnamed1370();
|
| }
|
| buildCounterPublishResponse--;
|
| return o;
|
| @@ -384,19 +384,19 @@ buildPublishResponse() {
|
| checkPublishResponse(api.PublishResponse o) {
|
| buildCounterPublishResponse++;
|
| if (buildCounterPublishResponse < 3) {
|
| - checkUnnamed1348(o.messageIds);
|
| + checkUnnamed1370(o.messageIds);
|
| }
|
| buildCounterPublishResponse--;
|
| }
|
|
|
| -buildUnnamed1349() {
|
| +buildUnnamed1371() {
|
| var o = new core.Map<core.String, core.String>();
|
| o["x"] = "foo";
|
| o["y"] = "foo";
|
| return o;
|
| }
|
|
|
| -checkUnnamed1349(core.Map<core.String, core.String> o) {
|
| +checkUnnamed1371(core.Map<core.String, core.String> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| unittest.expect(o["x"], unittest.equals('foo'));
|
| unittest.expect(o["y"], unittest.equals('foo'));
|
| @@ -407,7 +407,7 @@ buildPubsubMessage() {
|
| var o = new api.PubsubMessage();
|
| buildCounterPubsubMessage++;
|
| if (buildCounterPubsubMessage < 3) {
|
| - o.attributes = buildUnnamed1349();
|
| + o.attributes = buildUnnamed1371();
|
| o.data = "foo";
|
| o.messageId = "foo";
|
| o.publishTime = "foo";
|
| @@ -419,7 +419,7 @@ buildPubsubMessage() {
|
| checkPubsubMessage(api.PubsubMessage o) {
|
| buildCounterPubsubMessage++;
|
| if (buildCounterPubsubMessage < 3) {
|
| - checkUnnamed1349(o.attributes);
|
| + checkUnnamed1371(o.attributes);
|
| unittest.expect(o.data, unittest.equals('foo'));
|
| unittest.expect(o.messageId, unittest.equals('foo'));
|
| unittest.expect(o.publishTime, unittest.equals('foo'));
|
| @@ -448,14 +448,14 @@ checkPullRequest(api.PullRequest o) {
|
| buildCounterPullRequest--;
|
| }
|
|
|
| -buildUnnamed1350() {
|
| +buildUnnamed1372() {
|
| var o = new core.List<api.ReceivedMessage>();
|
| o.add(buildReceivedMessage());
|
| o.add(buildReceivedMessage());
|
| return o;
|
| }
|
|
|
| -checkUnnamed1350(core.List<api.ReceivedMessage> o) {
|
| +checkUnnamed1372(core.List<api.ReceivedMessage> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkReceivedMessage(o[0]);
|
| checkReceivedMessage(o[1]);
|
| @@ -466,7 +466,7 @@ buildPullResponse() {
|
| var o = new api.PullResponse();
|
| buildCounterPullResponse++;
|
| if (buildCounterPullResponse < 3) {
|
| - o.receivedMessages = buildUnnamed1350();
|
| + o.receivedMessages = buildUnnamed1372();
|
| }
|
| buildCounterPullResponse--;
|
| return o;
|
| @@ -475,19 +475,19 @@ buildPullResponse() {
|
| checkPullResponse(api.PullResponse o) {
|
| buildCounterPullResponse++;
|
| if (buildCounterPullResponse < 3) {
|
| - checkUnnamed1350(o.receivedMessages);
|
| + checkUnnamed1372(o.receivedMessages);
|
| }
|
| buildCounterPullResponse--;
|
| }
|
|
|
| -buildUnnamed1351() {
|
| +buildUnnamed1373() {
|
| var o = new core.Map<core.String, core.String>();
|
| o["x"] = "foo";
|
| o["y"] = "foo";
|
| return o;
|
| }
|
|
|
| -checkUnnamed1351(core.Map<core.String, core.String> o) {
|
| +checkUnnamed1373(core.Map<core.String, core.String> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| unittest.expect(o["x"], unittest.equals('foo'));
|
| unittest.expect(o["y"], unittest.equals('foo'));
|
| @@ -498,7 +498,7 @@ buildPushConfig() {
|
| var o = new api.PushConfig();
|
| buildCounterPushConfig++;
|
| if (buildCounterPushConfig < 3) {
|
| - o.attributes = buildUnnamed1351();
|
| + o.attributes = buildUnnamed1373();
|
| o.pushEndpoint = "foo";
|
| }
|
| buildCounterPushConfig--;
|
| @@ -508,7 +508,7 @@ buildPushConfig() {
|
| checkPushConfig(api.PushConfig o) {
|
| buildCounterPushConfig++;
|
| if (buildCounterPushConfig < 3) {
|
| - checkUnnamed1351(o.attributes);
|
| + checkUnnamed1373(o.attributes);
|
| unittest.expect(o.pushEndpoint, unittest.equals('foo'));
|
| }
|
| buildCounterPushConfig--;
|
| @@ -579,14 +579,14 @@ checkSubscription(api.Subscription o) {
|
| buildCounterSubscription--;
|
| }
|
|
|
| -buildUnnamed1352() {
|
| +buildUnnamed1374() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed1352(core.List<core.String> o) {
|
| +checkUnnamed1374(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'));
|
| @@ -597,7 +597,7 @@ buildTestIamPermissionsRequest() {
|
| var o = new api.TestIamPermissionsRequest();
|
| buildCounterTestIamPermissionsRequest++;
|
| if (buildCounterTestIamPermissionsRequest < 3) {
|
| - o.permissions = buildUnnamed1352();
|
| + o.permissions = buildUnnamed1374();
|
| }
|
| buildCounterTestIamPermissionsRequest--;
|
| return o;
|
| @@ -606,19 +606,19 @@ buildTestIamPermissionsRequest() {
|
| checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) {
|
| buildCounterTestIamPermissionsRequest++;
|
| if (buildCounterTestIamPermissionsRequest < 3) {
|
| - checkUnnamed1352(o.permissions);
|
| + checkUnnamed1374(o.permissions);
|
| }
|
| buildCounterTestIamPermissionsRequest--;
|
| }
|
|
|
| -buildUnnamed1353() {
|
| +buildUnnamed1375() {
|
| var o = new core.List<core.String>();
|
| o.add("foo");
|
| o.add("foo");
|
| return o;
|
| }
|
|
|
| -checkUnnamed1353(core.List<core.String> o) {
|
| +checkUnnamed1375(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'));
|
| @@ -629,7 +629,7 @@ buildTestIamPermissionsResponse() {
|
| var o = new api.TestIamPermissionsResponse();
|
| buildCounterTestIamPermissionsResponse++;
|
| if (buildCounterTestIamPermissionsResponse < 3) {
|
| - o.permissions = buildUnnamed1353();
|
| + o.permissions = buildUnnamed1375();
|
| }
|
| buildCounterTestIamPermissionsResponse--;
|
| return o;
|
| @@ -638,7 +638,7 @@ buildTestIamPermissionsResponse() {
|
| checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) {
|
| buildCounterTestIamPermissionsResponse++;
|
| if (buildCounterTestIamPermissionsResponse < 3) {
|
| - checkUnnamed1353(o.permissions);
|
| + checkUnnamed1375(o.permissions);
|
| }
|
| buildCounterTestIamPermissionsResponse--;
|
| }
|
| @@ -853,6 +853,153 @@ main() {
|
| });
|
|
|
|
|
| + unittest.group("resource-ProjectsSnapshotsResourceApi", () {
|
| + unittest.test("method--getIamPolicy", () {
|
| +
|
| + var mock = new HttpServerMock();
|
| + api.ProjectsSnapshotsResourceApi res = new api.PubsubApi(mock).projects.snapshots;
|
| + var arg_resource = "foo";
|
| + mock.register(unittest.expectAsync((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("/"));
|
| + pathOffset += 1;
|
| + 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;
|
| +
|
| + var query = (req.url).query;
|
| + var queryOffset = 0;
|
| + var queryMap = {};
|
| + addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
|
| + parseBool(n) {
|
| + if (n == "true") return true;
|
| + if (n == "false") return false;
|
| + 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]));
|
| + }
|
| + }
|
| +
|
| +
|
| + var h = {
|
| + "content-type" : "application/json; charset=utf-8",
|
| + };
|
| + var resp = convert.JSON.encode(buildPolicy());
|
| + return new async.Future.value(stringResponse(200, h, resp));
|
| + }), true);
|
| + res.getIamPolicy(arg_resource).then(unittest.expectAsync(((api.Policy response) {
|
| + checkPolicy(response);
|
| + })));
|
| + });
|
| +
|
| + unittest.test("method--setIamPolicy", () {
|
| +
|
| + var mock = new HttpServerMock();
|
| + api.ProjectsSnapshotsResourceApi res = new api.PubsubApi(mock).projects.snapshots;
|
| + var arg_request = buildSetIamPolicyRequest();
|
| + var arg_resource = "foo";
|
| + mock.register(unittest.expectAsync((http.BaseRequest req, json) {
|
| + var obj = new api.SetIamPolicyRequest.fromJson(json);
|
| + checkSetIamPolicyRequest(obj);
|
| +
|
| + var path = (req.url).path;
|
| + var pathOffset = 0;
|
| + var index;
|
| + var subPart;
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + pathOffset += 1;
|
| + 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;
|
| +
|
| + var query = (req.url).query;
|
| + var queryOffset = 0;
|
| + var queryMap = {};
|
| + addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
|
| + parseBool(n) {
|
| + if (n == "true") return true;
|
| + if (n == "false") return false;
|
| + 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]));
|
| + }
|
| + }
|
| +
|
| +
|
| + var h = {
|
| + "content-type" : "application/json; charset=utf-8",
|
| + };
|
| + var resp = convert.JSON.encode(buildPolicy());
|
| + return new async.Future.value(stringResponse(200, h, resp));
|
| + }), true);
|
| + res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((api.Policy response) {
|
| + checkPolicy(response);
|
| + })));
|
| + });
|
| +
|
| + unittest.test("method--testIamPermissions", () {
|
| +
|
| + var mock = new HttpServerMock();
|
| + api.ProjectsSnapshotsResourceApi res = new api.PubsubApi(mock).projects.snapshots;
|
| + var arg_request = buildTestIamPermissionsRequest();
|
| + var arg_resource = "foo";
|
| + mock.register(unittest.expectAsync((http.BaseRequest req, json) {
|
| + var obj = new api.TestIamPermissionsRequest.fromJson(json);
|
| + checkTestIamPermissionsRequest(obj);
|
| +
|
| + var path = (req.url).path;
|
| + var pathOffset = 0;
|
| + var index;
|
| + var subPart;
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + pathOffset += 1;
|
| + 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;
|
| +
|
| + var query = (req.url).query;
|
| + var queryOffset = 0;
|
| + var queryMap = {};
|
| + addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
|
| + parseBool(n) {
|
| + if (n == "true") return true;
|
| + if (n == "false") return false;
|
| + 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]));
|
| + }
|
| + }
|
| +
|
| +
|
| + var h = {
|
| + "content-type" : "application/json; charset=utf-8",
|
| + };
|
| + var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
|
| + return new async.Future.value(stringResponse(200, h, resp));
|
| + }), true);
|
| + res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsync(((api.TestIamPermissionsResponse response) {
|
| + checkTestIamPermissionsResponse(response);
|
| + })));
|
| + });
|
| +
|
| + });
|
| +
|
| +
|
| unittest.group("resource-ProjectsSubscriptionsResourceApi", () {
|
| unittest.test("method--acknowledge", () {
|
|
|
|
|