From 49ba519ce35fa63045668d4ddf080166bd895a1b Mon Sep 17 00:00:00 2001 From: Adrien Castex Date: Mon, 15 May 2017 15:13:38 +0200 Subject: [PATCH] Cleaned the code of some tests --- test/tests/deletePhysicalFile.js | 4 ++-- test/tests/deletePhysicalFolder.js | 4 ++-- test/tests/deleteVirtualFile.js | 4 ++-- test/tests/deleteVirtualFolder.js | 4 ++-- test/tests/etagPhysicalFile.js | 4 ++-- test/tests/etagVirtualFile.js | 4 ++-- test/tests/listRootFolder.js | 4 ++-- test/tests/makeFolder.js | 4 ++-- test/tests/readPhysicalFile.js | 4 ++-- test/tests/readVirtualFile.js | 4 ++-- test/tests/statPhysical.js | 2 +- test/tests/statVirtual.js | 5 ++--- test/tests/writeCreatePhysicalFile.js | 4 ++-- test/tests/writeCreateVirtualFile.js | 4 ++-- test/tests/writePhysicalFile.js | 4 ++-- test/tests/writeVirtualFile.js | 4 ++-- 16 files changed, 31 insertions(+), 32 deletions(-) diff --git a/test/tests/deletePhysicalFile.js b/test/tests/deletePhysicalFile.js index 33769c69..d18c8b9c 100644 --- a/test/tests/deletePhysicalFile.js +++ b/test/tests/deletePhysicalFile.js @@ -1,5 +1,5 @@ var webdav = require('../../lib/index.js'), - Client = require("webdav-fs"), + Client = require('webdav-fs'), path = require('path'), fs = require('fs') @@ -10,7 +10,7 @@ module.exports = (test, options, index) => test('delete a physical file', isVali isValid = isValid.multiple(1, server); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); const fileName = 'file.txt'; diff --git a/test/tests/deletePhysicalFolder.js b/test/tests/deletePhysicalFolder.js index b9258206..57024d67 100644 --- a/test/tests/deletePhysicalFolder.js +++ b/test/tests/deletePhysicalFolder.js @@ -1,5 +1,5 @@ var webdav = require('../../lib/index.js'), - Client = require("webdav-fs"), + Client = require('webdav-fs'), path = require('path'), fs = require('fs') @@ -10,7 +10,7 @@ module.exports = (test, options, index) => test('delete a physical folder', isVa isValid = isValid.multiple(2, server); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); const folderName = 'emptyFolder'; diff --git a/test/tests/deleteVirtualFile.js b/test/tests/deleteVirtualFile.js index 4873ee2e..354d55b0 100644 --- a/test/tests/deleteVirtualFile.js +++ b/test/tests/deleteVirtualFile.js @@ -1,5 +1,5 @@ var webdav = require('../../lib/index.js'), - Client = require("webdav-fs") + Client = require('webdav-fs') module.exports = (test, options, index) => test('delete a virtual file', isValid => { @@ -8,7 +8,7 @@ module.exports = (test, options, index) => test('delete a virtual file', isValid isValid = isValid.multiple(2, server); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); const fileName = 'file.txt'; diff --git a/test/tests/deleteVirtualFolder.js b/test/tests/deleteVirtualFolder.js index 0c1806e4..8aa4b19b 100644 --- a/test/tests/deleteVirtualFolder.js +++ b/test/tests/deleteVirtualFolder.js @@ -1,5 +1,5 @@ var webdav = require('../../lib/index.js'), - Client = require("webdav-fs") + Client = require('webdav-fs') module.exports = (test, options, index) => test('delete a virtual folder', isValid => { @@ -8,7 +8,7 @@ module.exports = (test, options, index) => test('delete a virtual folder', isVal isValid = isValid.multiple(2, server); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); const folderName = 'folder'; diff --git a/test/tests/etagPhysicalFile.js b/test/tests/etagPhysicalFile.js index f7272be4..71e80adb 100644 --- a/test/tests/etagPhysicalFile.js +++ b/test/tests/etagPhysicalFile.js @@ -25,13 +25,13 @@ module.exports = (test, options, index) => test('etag of physical file', isValid server.start(options.port + index); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); function propfind(callback) { request({ - url: "http://127.0.0.1:" + (options.port + index) + '/testFile.txt', + url: 'http://127.0.0.1:' + (options.port + index) + '/testFile.txt', method: 'PROPFIND' }, (e, res, body) => { if(e) diff --git a/test/tests/etagVirtualFile.js b/test/tests/etagVirtualFile.js index e585bb70..98f6ae41 100644 --- a/test/tests/etagVirtualFile.js +++ b/test/tests/etagVirtualFile.js @@ -17,13 +17,13 @@ module.exports = (test, options, index) => test('etag of virtual file', isValid server.start(options.port + index); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); function propfind(callback) { request({ - url: "http://127.0.0.1:" + (options.port + index) + '/testFile.txt', + url: 'http://127.0.0.1:' + (options.port + index) + '/testFile.txt', method: 'PROPFIND' }, (e, res, body) => { if(e) diff --git a/test/tests/listRootFolder.js b/test/tests/listRootFolder.js index 509bb0f4..61d79807 100644 --- a/test/tests/listRootFolder.js +++ b/test/tests/listRootFolder.js @@ -1,5 +1,5 @@ var webdav = require('../../lib/index.js'), - Client = require("webdav-fs") + Client = require('webdav-fs') module.exports = (test, options, index) => test('list root folder', isValid => { @@ -15,7 +15,7 @@ module.exports = (test, options, index) => test('list root folder', isValid => server.start(options.port + index); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); wfs.readdir('/', (e, files) => { diff --git a/test/tests/makeFolder.js b/test/tests/makeFolder.js index 44e1f4f2..c309ce87 100644 --- a/test/tests/makeFolder.js +++ b/test/tests/makeFolder.js @@ -1,5 +1,5 @@ var webdav = require('../../lib/index.js'), - Client = require("webdav-fs"), + Client = require('webdav-fs'), path = require('path'), fs = require('fs') @@ -17,7 +17,7 @@ module.exports = (test, options, index) => test('make a folder', isValid => server.start(options.port + index); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); wfs.mkdir('/testFile.txt/testFail', (e) => { diff --git a/test/tests/readPhysicalFile.js b/test/tests/readPhysicalFile.js index 797f1a44..a5ca770e 100644 --- a/test/tests/readPhysicalFile.js +++ b/test/tests/readPhysicalFile.js @@ -1,5 +1,5 @@ var webdav = require('../../lib/index.js'), - Client = require("webdav-fs"), + Client = require('webdav-fs'), path = require('path'), fs = require('fs') @@ -10,7 +10,7 @@ module.exports = (test, options, index) => test('read a physical file', isValid server.start(options.port + index); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); const fileName = 'file.txt'; diff --git a/test/tests/readVirtualFile.js b/test/tests/readVirtualFile.js index d657676d..a7d760bb 100644 --- a/test/tests/readVirtualFile.js +++ b/test/tests/readVirtualFile.js @@ -1,5 +1,5 @@ var webdav = require('../../lib/index.js'), - Client = require("webdav-fs") + Client = require('webdav-fs') module.exports = (test, options, index) => test('read a virtual file', isValid => { @@ -15,7 +15,7 @@ module.exports = (test, options, index) => test('read a virtual file', isValid = isValid = isValid.multiple(Object.keys(files).length + 1, server); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); for(const fileName in files) diff --git a/test/tests/statPhysical.js b/test/tests/statPhysical.js index ad9c37ef..aeabbf81 100644 --- a/test/tests/statPhysical.js +++ b/test/tests/statPhysical.js @@ -39,7 +39,7 @@ module.exports = (test, options, index) => test('stat of physical resources', is server.start(options.port + index); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); wfs.stat('/' + folderName + '/' + fileName, (e, stat) => { diff --git a/test/tests/statVirtual.js b/test/tests/statVirtual.js index 03ac0bd8..0b3630a4 100644 --- a/test/tests/statVirtual.js +++ b/test/tests/statVirtual.js @@ -1,6 +1,5 @@ var webdav = require('../../lib/index.js'), - Client = require('webdav-fs'), - request = require('request') + Client = require('webdav-fs') module.exports = (test, options, index) => test('stat of virtual resources', isValid => { @@ -29,7 +28,7 @@ module.exports = (test, options, index) => test('stat of virtual resources', isV server.start(options.port + index); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); wfs.stat('/testFolder/testFile.txt', (e, stat) => { diff --git a/test/tests/writeCreatePhysicalFile.js b/test/tests/writeCreatePhysicalFile.js index d37a1b9c..5d698cb7 100644 --- a/test/tests/writeCreatePhysicalFile.js +++ b/test/tests/writeCreatePhysicalFile.js @@ -1,5 +1,5 @@ var webdav = require('../../lib/index.js'), - Client = require("webdav-fs"), + Client = require('webdav-fs'), path = require('path'), fs = require('fs') @@ -10,7 +10,7 @@ module.exports = (test, options, index) => test('write/create a physical file', isValid = isValid.multiple(1, server); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); const folderName = 'writeCreatePhysicalFile'; diff --git a/test/tests/writeCreateVirtualFile.js b/test/tests/writeCreateVirtualFile.js index 0ad69a81..c7432b3c 100644 --- a/test/tests/writeCreateVirtualFile.js +++ b/test/tests/writeCreateVirtualFile.js @@ -1,5 +1,5 @@ var webdav = require('../../lib/index.js'), - Client = require("webdav-fs") + Client = require('webdav-fs') module.exports = (test, options, index) => test('write/create a virtual file', isValid => { @@ -8,7 +8,7 @@ module.exports = (test, options, index) => test('write/create a virtual file', i isValid = isValid.multiple(1, server); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); const fileName = 'file.txt'; diff --git a/test/tests/writePhysicalFile.js b/test/tests/writePhysicalFile.js index 31fd3007..85db1bae 100644 --- a/test/tests/writePhysicalFile.js +++ b/test/tests/writePhysicalFile.js @@ -1,5 +1,5 @@ var webdav = require('../../lib/index.js'), - Client = require("webdav-fs"), + Client = require('webdav-fs'), path = require('path'), fs = require('fs') @@ -15,7 +15,7 @@ module.exports = (test, options, index) => test('write in a physical file', isVa isValid = isValid.multiple(Object.keys(files).length, server); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); for(const fileName in files) diff --git a/test/tests/writeVirtualFile.js b/test/tests/writeVirtualFile.js index ce86cb66..ffdfef52 100644 --- a/test/tests/writeVirtualFile.js +++ b/test/tests/writeVirtualFile.js @@ -1,5 +1,5 @@ var webdav = require('../../lib/index.js'), - Client = require("webdav-fs") + Client = require('webdav-fs') module.exports = (test, options, index) => test('write in a virtual file', isValid => { @@ -13,7 +13,7 @@ module.exports = (test, options, index) => test('write in a virtual file', isVal isValid = isValid.multiple(Object.keys(files).length, server); var wfs = Client( - "http://127.0.0.1:" + (options.port + index) + 'http://127.0.0.1:' + (options.port + index) ); for(const fileName in files)