Skip to content

Commit

Permalink
Fixed the tests to use the new 'RequestContext' implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienCastex committed Jun 30, 2017
1 parent faf8581 commit 6d41b1b
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion test/v2/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ module.exports = (callback, options) => {
}
else
info.startServer();
info.ctx = webdav.RequestContext.createExternal(info.servers[0]);
info.ctx = webdav.ExternalRequestContext.create(info.servers[0]);
info.expect(nbExpected);
return info.servers[0];
},
Expand Down
2 changes: 1 addition & 1 deletion test/v2/tests.ts/delete/.createFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { v2 } from '../../../../lib/index.js'

export function starter(server : v2.WebDAVServer, info : TestInfo, isValid : TestCallback, name : string, expectedStatusCode : number, callback ?: (server : v2.WebDAVServer) => void) : void
{
server.rootFileSystem().addSubTree(v2.RequestContext.createExternal(server), {
server.rootFileSystem().addSubTree(v2.ExternalRequestContext.create(server), {
'emptyFolder1': v2.ResourceType.Directory,
'folder1': {
'emptyFolder2': v2.ResourceType.Directory,
Expand Down
2 changes: 1 addition & 1 deletion test/v2/tests.ts/lockUnlock/.createFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export function starter(
um.addUser('user2', 'password2'); // dXNlcjI6cGFzc3dvcmQy
server.httpAuthentication = new v2.HTTPBasicAuthentication(um, 'Test realm');
server.options.httpAuthentication = server.httpAuthentication;
server.rootFileSystem().addSubTree(v2.RequestContext.createExternal(server), {
server.rootFileSystem().addSubTree(v2.ExternalRequestContext.create(server), {
'folder': {
'folder2': {
'folder3': {
Expand Down
2 changes: 1 addition & 1 deletion test/v2/tests.ts/mkcol/.createFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { v2 } from '../../../../lib/index.js'

export function starter(server : v2.WebDAVServer, info : TestInfo, isValid : TestCallback, name : string, expectedStatusCode : number, callback ?: (server : v2.WebDAVServer) => void) : void
{
server.rootFileSystem().addSubTree(v2.RequestContext.createExternal(server), {
server.rootFileSystem().addSubTree(v2.ExternalRequestContext.create(server), {
'emptyFolder1': v2.ResourceType.Directory,
'folder1': {
'emptyFolder2': v2.ResourceType.Directory,
Expand Down
2 changes: 1 addition & 1 deletion test/v2/tests.ts/moveCopy/.createFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function check(server : v2.WebDAVServer, info : TestInfo, isValid : TestC

export function starter(server : v2.WebDAVServer, info : TestInfo, isValid : TestCallback, method : string, from : string, to : string, overwrite : boolean, expectedStatusCode : number, callback ?: (server : v2.WebDAVServer) => void) : void
{
server.rootFileSystem().addSubTree(v2.RequestContext.createExternal(server), {
server.rootFileSystem().addSubTree(v2.ExternalRequestContext.create(server), {
'emptyFolder1': v2.ResourceType.Directory,
'folder1': {
'emptyFolder2': v2.ResourceType.Directory,
Expand Down
2 changes: 1 addition & 1 deletion test/v2/tests.ts/options/.createFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { v2 } from '../../../../lib/index.js'

export function starter(server : v2.WebDAVServer, info : TestInfo, isValid : TestCallback, name : string, expect : string[], reject : string[], callback : (allowHeader ?: string[]) => void) : void
{
server.rootFileSystem().addSubTree(v2.RequestContext.createExternal(server), {
server.rootFileSystem().addSubTree(v2.ExternalRequestContext.create(server), {
'folder': v2.ResourceType.Directory,
'file': v2.ResourceType.File,
'hybrid': v2.ResourceType.Hybrid,
Expand Down
2 changes: 1 addition & 1 deletion test/v2/tests.ts/persistence/.createPersistenceContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function starter(info : TestInfo, isValid : TestCallback, callback : (ser
tempTreeFilePath: fileTemp
}
})
server.rootFileSystem().addSubTree(v2.RequestContext.createExternal(server), {
server.rootFileSystem().addSubTree(v2.ExternalRequestContext.create(server), {
'emptyFolder1': v2.ResourceType.Directory,
'folder1': {
'emptyFolder2': v2.ResourceType.Directory,
Expand Down
2 changes: 1 addition & 1 deletion test/v2/tests.ts/properties/.createFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function propfind(server : v2.WebDAVServer, info : TestInfo, path : strin
export function starter(info : TestInfo, isValid : TestCallback, callback : (server : v2.WebDAVServer) => void) : void
{
const server = info.startServer();
server.rootFileSystem().addSubTree(v2.RequestContext.createExternal(server), {
server.rootFileSystem().addSubTree(v2.ExternalRequestContext.create(server), {
'folder': v2.ResourceType.Directory,
'file': v2.ResourceType.File
}, (e) => {
Expand Down
2 changes: 1 addition & 1 deletion test/v2/tests.ts/readDir/.createDir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function starter(server : v2.WebDAVServer, info : TestInfo, isValid : Tes
'subFile2'
];
const name = 'folder';
const ctx = v2.RequestContext.createExternal(server);
const ctx = v2.ExternalRequestContext.create(server);
server.rootFileSystem().addSubTree(ctx, {
[name]: {
'subFolder1': v2.ResourceType.Directory,
Expand Down
2 changes: 1 addition & 1 deletion test/v2/tests.ts/readWrite/.createFileTxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function starter(server : v2.WebDAVServer, info : TestInfo, isValid : Tes
const type = _callback ? _type as v2.ResourceType : v2.ResourceType.File;

const name = 'file.txt';
const ctx = v2.RequestContext.createExternal(server);
const ctx = v2.ExternalRequestContext.create(server);
server.rootFileSystem().addSubTree(ctx, {
[name]: type
}, (e) => {
Expand Down
2 changes: 1 addition & 1 deletion test/v2/tests.ts/server/addSubTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default ((info, isValid) =>
})
}

server.rootFileSystem().addSubTree(v2.RequestContext.createExternal(server), {
server.rootFileSystem().addSubTree(v2.ExternalRequestContext.create(server), {
'emptyFolder1': v2.ResourceType.Directory,
'folder1': {
'emptyFolder2': v2.ResourceType.Directory,
Expand Down

0 comments on commit 6d41b1b

Please sign in to comment.