Add two more tests

This commit is contained in:
Raymond Feng 2013-06-24 16:19:06 -07:00
parent 8eab9b5614
commit 26f619fb63
2 changed files with 15 additions and 1 deletions

View File

@ -153,7 +153,6 @@ FileSystemProvider.prototype.getFile = function (container, file, cb) {
FileSystemProvider.prototype.removeFile = function (container, file, cb) {
if(!validateName(container, cb)) return;
var container = options.container;
if(!validateName(file, cb)) return;
var filePath = path.join(this.root, container, file);

View File

@ -118,6 +118,21 @@ describe('FileSystem based storage provider', function () {
});
});
it('should remove a file', function (done) {
client.removeFile('c1', 'f1.txt', function (err) {
assert(!err);
done(err);
});
});
it('should get no files from a container', function (done) {
client.getFiles('c1', function (err, files) {
assert(!err);
assert.equal(0, files.length);
done(err, files);
});
});
it('should destroy a container c1', function (done) {
client.destroyContainer('c1', function (err, container) {
// console.error(err);