+ // We accept any file now
+ // it('Should fail with an invalid captionfile extension', async function () {
+ // const attaches = {
+ // 'captionfile': buildAbsoluteFixturePath('subtitle-bad.txt')
+ // }
+ //
+ // const captionPath = path + video.uuid + '/captions/fr'
+ // await makeUploadRequest({
+ // method: 'PUT',
+ // url: server.url,
+ // path: captionPath,
+ // token: server.accessToken,
+ // fields,
+ // attaches,
+ // expectedStatus: HttpStatusCode.BAD_REQUEST_400
+ // })
+ // })
+
+ // We don't check the extension yet
+ // it('Should fail with an invalid captionfile extension and octet-stream mime type', async function () {
+ // await createVideoCaption({
+ // url: server.url,
+ // accessToken: server.accessToken,
+ // language: 'zh',
+ // videoId: video.uuid,
+ // fixture: 'subtitle-bad.txt',
+ // mimeType: 'application/octet-stream',
+ // expectedStatus: HttpStatusCode.BAD_REQUEST_400
+ // })
+ // })
+
+ it('Should succeed with a valid captionfile extension and octet-stream mime type', async function () {
+ await server.captions.add({
+ language: 'zh',
+ videoId: video.uuid,
+ fixture: 'subtitle-good.srt',
+ mimeType: 'application/octet-stream'
+ })
+ })
+
+ // We don't check the file validity yet
+ // it('Should fail with an invalid captionfile srt', async function () {
+ // const attaches = {
+ // 'captionfile': buildAbsoluteFixturePath('subtitle-bad.srt')
+ // }
+ //
+ // const captionPath = path + video.uuid + '/captions/fr'
+ // await makeUploadRequest({
+ // method: 'PUT',
+ // url: server.url,
+ // path: captionPath,
+ // token: server.accessToken,
+ // fields,
+ // attaches,
+ // expectedStatus: HttpStatusCode.INTERNAL_SERVER_ERROR_500
+ // })
+ // })
+