UNPKG

ks3

Version:

本代码库为`金山云存储KS3`服务.主要提供`KS3 nodejs SDK`和`命令行工具`.

36 lines (34 loc) 1.19 kB
var KS3 = require('..'); var should = require('should'); const { ak, sk, endpoint} = require('./config') describe('KS3 config proxy', function() { var bucketName = 'test-sdk-' + (+new Date()); var client = new KS3(ak, sk, bucketName); var acl = 'public-read'; it('should change the default config in config.js', function() { var testCfg = { proxyUrl : 'http://127.0.0.1:2221', proxyAuth: { user: 'ks3-test', // 代理认证的用户名 pass: 'ks3test111' // 代理认证的密码 }, ua : 'TEST_KS3_NodeJS' }; client.config(testCfg); var config = require('./../config'); config.proxyUrl.should.equal('http://127.0.0.1:2221'); config.proxyAuth.user.should.equal('ks3-test'); config.proxyAuth.pass.should.equal('ks3test111'); }); it('should support proxy', function(done) { client.bucket.put({ Bucket: bucketName, ACL: acl }, function(err, data, res) { console.log('bucket created:', bucketName, err, data, res.statusCode) should.not.exist(err); res.statusCode.should.equal(200); done() }); }) });