MCPcopy
hub / github.com/scality/cloudserver / _comparePutGetXml

Function _comparePutGetXml

tests/unit/api/bucketGetCors.js:42–59  ·  view source on GitHub ↗
(sampleXml, done)

Source from the content-addressed store, hash-verified

40const testGetCorsRequest = _makeCorsRequest();
41
42function _comparePutGetXml(sampleXml, done) {
43 const fullXml = '<?xml version="1.0" encoding="UTF-8" ' +
44 'standalone="yes"?><CORSConfiguration>' +
45 `${sampleXml}</CORSConfiguration>`;
46 const testPutCorsRequest = _makeCorsRequest(fullXml);
47 bucketPutCors(authInfo, testPutCorsRequest, log, err => {
48 if (err) {
49 process.stdout.write(`Err putting cors config ${err}`);
50 return done(err);
51 }
52 return bucketGetCors(authInfo, testGetCorsRequest, log,
53 (err, res) => {
54 assert.strictEqual(err, null, `Unexpected err ${err}`);
55 assert.strictEqual(res, fullXml);
56 done();
57 });
58 });
59}
60
61describe('getBucketCors API', () => {
62 beforeEach(done => {

Callers 1

bucketGetCors.jsFile · 0.70

Calls 4

_makeCorsRequestFunction · 0.85
bucketPutCorsFunction · 0.85
bucketGetCorsFunction · 0.85
writeMethod · 0.80

Tested by

no test coverage detected