From 3545e72c686ff1725bbdfd8d16d693e2f4aa75a3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 12 Oct 2022 16:09:02 +0200 Subject: Put private videos under a specific subdirectory --- server/tests/api/object-storage/videos.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'server/tests/api/object-storage/videos.ts') diff --git a/server/tests/api/object-storage/videos.ts b/server/tests/api/object-storage/videos.ts index 3e65e1093..63f5179c7 100644 --- a/server/tests/api/object-storage/videos.ts +++ b/server/tests/api/object-storage/videos.ts @@ -59,11 +59,11 @@ async function checkFiles (options: { expectStartWith(file.fileUrl, start) - const res = await makeRawRequest(file.fileDownloadUrl, HttpStatusCode.FOUND_302) + const res = await makeRawRequest({ url: file.fileDownloadUrl, expectedStatus: HttpStatusCode.FOUND_302 }) const location = res.headers['location'] expectStartWith(location, start) - await makeRawRequest(location, HttpStatusCode.OK_200) + await makeRawRequest({ url: location, expectedStatus: HttpStatusCode.OK_200 }) } const hls = video.streamingPlaylists[0] @@ -81,19 +81,19 @@ async function checkFiles (options: { expectStartWith(hls.playlistUrl, start) expectStartWith(hls.segmentsSha256Url, start) - await makeRawRequest(hls.playlistUrl, HttpStatusCode.OK_200) + await makeRawRequest({ url: hls.playlistUrl, expectedStatus: HttpStatusCode.OK_200 }) - const resSha = await makeRawRequest(hls.segmentsSha256Url, HttpStatusCode.OK_200) + const resSha = await makeRawRequest({ url: hls.segmentsSha256Url, expectedStatus: HttpStatusCode.OK_200 }) expect(JSON.stringify(resSha.body)).to.not.throw for (const file of hls.files) { expectStartWith(file.fileUrl, start) - const res = await makeRawRequest(file.fileDownloadUrl, HttpStatusCode.FOUND_302) + const res = await makeRawRequest({ url: file.fileDownloadUrl, expectedStatus: HttpStatusCode.FOUND_302 }) const location = res.headers['location'] expectStartWith(location, start) - await makeRawRequest(location, HttpStatusCode.OK_200) + await makeRawRequest({ url: location, expectedStatus: HttpStatusCode.OK_200 }) } } @@ -104,7 +104,7 @@ async function checkFiles (options: { expect(torrent.files.length).to.equal(1) expect(torrent.files[0].path).to.exist.and.to.not.equal('') - const res = await makeRawRequest(file.fileUrl, HttpStatusCode.OK_200) + const res = await makeRawRequest({ url: file.fileUrl, expectedStatus: HttpStatusCode.OK_200 }) expect(res.body).to.have.length.above(100) } @@ -220,7 +220,7 @@ function runTestSuite (options: { it('Should fetch correctly all the files', async function () { for (const url of deletedUrls.concat(keptUrls)) { - await makeRawRequest(url, HttpStatusCode.OK_200) + await makeRawRequest({ url, expectedStatus: HttpStatusCode.OK_200 }) } }) @@ -231,13 +231,13 @@ function runTestSuite (options: { await waitJobs(servers) for (const url of deletedUrls) { - await makeRawRequest(url, HttpStatusCode.NOT_FOUND_404) + await makeRawRequest({ url, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) } }) it('Should have kept other files', async function () { for (const url of keptUrls) { - await makeRawRequest(url, HttpStatusCode.OK_200) + await makeRawRequest({ url, expectedStatus: HttpStatusCode.OK_200 }) } }) -- cgit v1.2.3