backups: add setup/teardown
1. add setup, teardown hooks 2. move the managed mount setup and teardown to filesystem backend 3. remove this vague storage.js we should convert storageApi into a real object, so we don't have to keep passing apiConfig around
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = {
|
||||
setup,
|
||||
teardown,
|
||||
cleanup,
|
||||
|
||||
testConfig,
|
||||
removePrivateFields,
|
||||
injectPrivateFields,
|
||||
|
||||
getAvailableSize,
|
||||
|
||||
upload,
|
||||
@@ -13,12 +21,6 @@ exports = module.exports = {
|
||||
remove,
|
||||
removeDir,
|
||||
|
||||
cleanup,
|
||||
|
||||
testConfig,
|
||||
removePrivateFields,
|
||||
injectPrivateFields,
|
||||
|
||||
// Used to mock AWS
|
||||
_chunk: chunk
|
||||
};
|
||||
@@ -613,6 +615,14 @@ async function testConfig(apiConfig) {
|
||||
if (delError) throw new BoxError(BoxError.EXTERNAL_ERROR, `Error del object cloudron-testfile. ${formatError(delError)}`);
|
||||
}
|
||||
|
||||
async function setup(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
}
|
||||
|
||||
async function teardown(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
}
|
||||
|
||||
function removePrivateFields(apiConfig) {
|
||||
apiConfig.secretAccessKey = constants.SECRET_PLACEHOLDER;
|
||||
return apiConfig;
|
||||
|
||||
Reference in New Issue
Block a user