Skip to content

Commit

Permalink
修改用例
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Dec 10, 2020
1 parent b9a8bdf commit 091cbd4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1801,9 +1801,14 @@ group('BucketPolicy', function () {
"name/cos:AbortMultipartUpload",
"name/cos:AppendObject"
],
"resource": ["qcs::cos:" + config.Region + ":uid/" + AppId + ":" + BucketLongName + ".cos." + config.Region + ".myqcloud.com//" + AppId + "/" + BucketShortName + "/" + Prefix + "/*"] // 1250000000 是 appid
"resource": ["qcs::cos:" + config.Region + ":uid/" + AppId + ":" + BucketLongName + "//" + AppId + "/" + BucketShortName + "/" + Prefix + "/*"] // 1250000000 是 appid
}]
};
var getRes = function (s) {
var t = s && s[0];
var res = t && t.resource && t.resource[0];
return res;
};
test('putBucketPolicy(),getBucketPolicy()', function (done, assert) {
cos.putBucketPolicy({
Bucket: config.Bucket,
Expand All @@ -1815,7 +1820,7 @@ group('BucketPolicy', function () {
Bucket: config.Bucket,
Region: config.Region
}, function (err, data) {
assert.ok(Policy, data.Policy);
assert.ok(getRes(Policy.statement) === getRes(data.Policy.Statement));
done();
});
});
Expand All @@ -1831,7 +1836,7 @@ group('BucketPolicy', function () {
Bucket: config.Bucket,
Region: config.Region
}, function (err, data) {
assert.ok(Policy, data.Policy);
assert.ok(getRes(Policy.statement) === getRes(data.Policy.Statement));
done();
});
});
Expand Down

0 comments on commit 091cbd4

Please sign in to comment.