From 08452006cf70be69dd59ccf03c5844d8b06fc2c4 Mon Sep 17 00:00:00 2001 From: csg01123119 Date: Thu, 17 Aug 2023 15:32:29 +0800 Subject: [PATCH] test: delete bukcet_worm.test.js --- test/node/bukcet_worm.test.js | 81 ----------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 test/node/bukcet_worm.test.js diff --git a/test/node/bukcet_worm.test.js b/test/node/bukcet_worm.test.js deleted file mode 100644 index c6b3d4a54..000000000 --- a/test/node/bukcet_worm.test.js +++ /dev/null @@ -1,81 +0,0 @@ -const assert = require('assert'); -const utils = require('./utils'); -const oss = require('../..'); -const { oss: config, timeout } = require('../config'); - -describe('test/bucket.test.js', () => { - const { prefix } = utils; - let store; - let bucket; - const defaultRegion = config.region; - before(async () => { - store = oss(config); - config.region = defaultRegion; - store = oss(config); - bucket = `ali-oss-test-worm2-bucket-${prefix.replace(/[/.]/g, '-')}`; - bucket = bucket.substring(0, bucket.length - 1); - - const result = await store.putBucket(bucket, { timeout }); - assert.equal(result.bucket, bucket); - assert.equal(result.res.status, 200); - }); - - // github CI will remove buckets - // restore object will have cache - // after(async () => { - // await utils.cleanBucket(store, bucket); - // }); - - describe('worm()', () => { - describe('initiateBucketWorm()', () => { - it('should init bucket worm', async () => { - try { - await store.initiateBucketWorm(bucket, '1'); - assert(true); - } catch (error) { - assert(false, error); - } - }); - }); - describe('abortBucketWorm()', () => { - it('should abort bucket worm', async () => { - try { - await store.abortBucketWorm(bucket); - assert(true); - } catch (error) { - assert(false, error); - } - }); - }); - describe('completeBucketWorm(), getBucketWorm()', () => { - it('should complete bucket worm', async () => { - const { wormId } = await store.initiateBucketWorm(bucket, '1'); - try { - await store.completeBucketWorm(bucket, wormId); - assert(true); - } catch (error) { - assert(false, error); - } - - try { - const result = await store.getBucketWorm(bucket); - assert(result.wormId); - } catch (error) { - assert(false, error); - } - }); - }); - describe('extendBucketWorm()', () => { - it('should extend bucket worm', async () => { - try { - const { wormId, days } = await store.getBucketWorm(bucket); - await store.extendBucketWorm(bucket, wormId, (days * 1 + 1).toString()); - const result = await store.getBucketWorm(bucket); - assert(result.days - days === 1); - } catch (error) { - assert(false, error); - } - }); - }); - }); -});