diff options
Diffstat (limited to 'server/tests/api/videos/resumable-upload.ts')
-rw-r--r-- | server/tests/api/videos/resumable-upload.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/server/tests/api/videos/resumable-upload.ts b/server/tests/api/videos/resumable-upload.ts index b7756a4a8..2f1cf8a55 100644 --- a/server/tests/api/videos/resumable-upload.ts +++ b/server/tests/api/videos/resumable-upload.ts | |||
@@ -36,14 +36,14 @@ describe('Test resumable upload', function () { | |||
36 | 36 | ||
37 | const attributes = { | 37 | const attributes = { |
38 | name: 'video', | 38 | name: 'video', |
39 | channelId: server.videoChannel.id, | 39 | channelId: server.store.channel.id, |
40 | privacy: VideoPrivacy.PUBLIC, | 40 | privacy: VideoPrivacy.PUBLIC, |
41 | fixture: defaultFixture | 41 | fixture: defaultFixture |
42 | } | 42 | } |
43 | 43 | ||
44 | const mimetype = 'video/mp4' | 44 | const mimetype = 'video/mp4' |
45 | 45 | ||
46 | const res = await server.videosCommand.prepareResumableUpload({ attributes, size, mimetype }) | 46 | const res = await server.videos.prepareResumableUpload({ attributes, size, mimetype }) |
47 | 47 | ||
48 | return res.header['location'].split('?')[1] | 48 | return res.header['location'].split('?')[1] |
49 | } | 49 | } |
@@ -61,7 +61,7 @@ describe('Test resumable upload', function () { | |||
61 | const size = await buildSize(defaultFixture, options.size) | 61 | const size = await buildSize(defaultFixture, options.size) |
62 | const absoluteFilePath = buildAbsoluteFixturePath(defaultFixture) | 62 | const absoluteFilePath = buildAbsoluteFixturePath(defaultFixture) |
63 | 63 | ||
64 | return server.videosCommand.sendResumableChunks({ | 64 | return server.videos.sendResumableChunks({ |
65 | pathUploadId, | 65 | pathUploadId, |
66 | videoFilePath: absoluteFilePath, | 66 | videoFilePath: absoluteFilePath, |
67 | size, | 67 | size, |
@@ -75,7 +75,7 @@ describe('Test resumable upload', function () { | |||
75 | const uploadId = uploadIdArg.replace(/^upload_id=/, '') | 75 | const uploadId = uploadIdArg.replace(/^upload_id=/, '') |
76 | 76 | ||
77 | const subPath = join('tmp', 'resumable-uploads', uploadId) | 77 | const subPath = join('tmp', 'resumable-uploads', uploadId) |
78 | const filePath = server.serversCommand.buildDirectory(subPath) | 78 | const filePath = server.servers.buildDirectory(subPath) |
79 | const exists = await pathExists(filePath) | 79 | const exists = await pathExists(filePath) |
80 | 80 | ||
81 | if (expectedSize === null) { | 81 | if (expectedSize === null) { |
@@ -90,7 +90,7 @@ describe('Test resumable upload', function () { | |||
90 | 90 | ||
91 | async function countResumableUploads () { | 91 | async function countResumableUploads () { |
92 | const subPath = join('tmp', 'resumable-uploads') | 92 | const subPath = join('tmp', 'resumable-uploads') |
93 | const filePath = server.serversCommand.buildDirectory(subPath) | 93 | const filePath = server.servers.buildDirectory(subPath) |
94 | 94 | ||
95 | const files = await readdir(filePath) | 95 | const files = await readdir(filePath) |
96 | return files.length | 96 | return files.length |
@@ -103,10 +103,10 @@ describe('Test resumable upload', function () { | |||
103 | await setAccessTokensToServers([ server ]) | 103 | await setAccessTokensToServers([ server ]) |
104 | await setDefaultVideoChannel([ server ]) | 104 | await setDefaultVideoChannel([ server ]) |
105 | 105 | ||
106 | const body = await server.usersCommand.getMyInfo() | 106 | const body = await server.users.getMyInfo() |
107 | rootId = body.id | 107 | rootId = body.id |
108 | 108 | ||
109 | await server.usersCommand.update({ userId: rootId, videoQuota: 10_000_000 }) | 109 | await server.users.update({ userId: rootId, videoQuota: 10_000_000 }) |
110 | }) | 110 | }) |
111 | 111 | ||
112 | describe('Directory cleaning', function () { | 112 | describe('Directory cleaning', function () { |
@@ -125,13 +125,13 @@ describe('Test resumable upload', function () { | |||
125 | }) | 125 | }) |
126 | 126 | ||
127 | it('Should not delete recent uploads', async function () { | 127 | it('Should not delete recent uploads', async function () { |
128 | await server.debugCommand.sendCommand({ body: { command: 'remove-dandling-resumable-uploads' } }) | 128 | await server.debug.sendCommand({ body: { command: 'remove-dandling-resumable-uploads' } }) |
129 | 129 | ||
130 | expect(await countResumableUploads()).to.equal(2) | 130 | expect(await countResumableUploads()).to.equal(2) |
131 | }) | 131 | }) |
132 | 132 | ||
133 | it('Should delete old uploads', async function () { | 133 | it('Should delete old uploads', async function () { |
134 | await server.debugCommand.sendCommand({ body: { command: 'remove-dandling-resumable-uploads' } }) | 134 | await server.debug.sendCommand({ body: { command: 'remove-dandling-resumable-uploads' } }) |
135 | 135 | ||
136 | expect(await countResumableUploads()).to.equal(0) | 136 | expect(await countResumableUploads()).to.equal(0) |
137 | }) | 137 | }) |