Skip to content

Commit

Permalink
Cleaned the code of some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienCastex committed May 15, 2017
1 parent 715fbbd commit 49ba519
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 32 deletions.
4 changes: 2 additions & 2 deletions test/tests/deletePhysicalFile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var webdav = require('../../lib/index.js'),
Client = require("webdav-fs"),
Client = require('webdav-fs'),
path = require('path'),
fs = require('fs')

Expand All @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions test/tests/deletePhysicalFolder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var webdav = require('../../lib/index.js'),
Client = require("webdav-fs"),
Client = require('webdav-fs'),
path = require('path'),
fs = require('fs')

Expand All @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions test/tests/deleteVirtualFile.js
Original file line number Diff line number Diff line change
@@ -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 =>
{
Expand All @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions test/tests/deleteVirtualFolder.js
Original file line number Diff line number Diff line change
@@ -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 =>
{
Expand All @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions test/tests/etagPhysicalFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/tests/etagVirtualFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/tests/listRootFolder.js
Original file line number Diff line number Diff line change
@@ -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 =>
{
Expand All @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions test/tests/makeFolder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var webdav = require('../../lib/index.js'),
Client = require("webdav-fs"),
Client = require('webdav-fs'),
path = require('path'),
fs = require('fs')

Expand All @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions test/tests/readPhysicalFile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var webdav = require('../../lib/index.js'),
Client = require("webdav-fs"),
Client = require('webdav-fs'),
path = require('path'),
fs = require('fs')

Expand All @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions test/tests/readVirtualFile.js
Original file line number Diff line number Diff line change
@@ -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 =>
{
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/tests/statPhysical.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
5 changes: 2 additions & 3 deletions test/tests/statVirtual.js
Original file line number Diff line number Diff line change
@@ -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 =>
{
Expand Down Expand Up @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions test/tests/writeCreatePhysicalFile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var webdav = require('../../lib/index.js'),
Client = require("webdav-fs"),
Client = require('webdav-fs'),
path = require('path'),
fs = require('fs')

Expand All @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions test/tests/writeCreateVirtualFile.js
Original file line number Diff line number Diff line change
@@ -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 =>
{
Expand All @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions test/tests/writePhysicalFile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var webdav = require('../../lib/index.js'),
Client = require("webdav-fs"),
Client = require('webdav-fs'),
path = require('path'),
fs = require('fs')

Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/tests/writeVirtualFile.js
Original file line number Diff line number Diff line change
@@ -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 =>
{
Expand All @@ -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)
Expand Down

0 comments on commit 49ba519

Please sign in to comment.