]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Move fixtures in tests/
authorChocobozzz <me@florianbigard.com>
Thu, 7 Jun 2018 07:48:10 +0000 (09:48 +0200)
committerChocobozzz <me@florianbigard.com>
Thu, 7 Jun 2018 07:57:35 +0000 (09:57 +0200)
31 files changed:
server/tests/api/check-params/users.ts
server/tests/api/check-params/videos.ts
server/tests/api/videos/multiple-servers.ts
server/tests/cli/create-import-video-file-job.ts
server/tests/fixtures/avatar-big.png [moved from server/tests/api/fixtures/avatar-big.png with 100% similarity]
server/tests/fixtures/avatar-resized.png [moved from server/tests/api/fixtures/avatar-resized.png with 100% similarity]
server/tests/fixtures/avatar.png [moved from server/tests/api/fixtures/avatar.png with 100% similarity]
server/tests/fixtures/avatar2-resized.png [moved from server/tests/api/fixtures/avatar2-resized.png with 100% similarity]
server/tests/fixtures/avatar2.png [moved from server/tests/api/fixtures/avatar2.png with 100% similarity]
server/tests/fixtures/preview.jpg [moved from server/tests/api/fixtures/preview.jpg with 100% similarity]
server/tests/fixtures/thumbnail.jpg [moved from server/tests/api/fixtures/thumbnail.jpg with 100% similarity]
server/tests/fixtures/video_60fps_short.mp4 [moved from server/tests/api/fixtures/video_60fps_short.mp4 with 100% similarity]
server/tests/fixtures/video_short-480.webm [moved from server/tests/api/fixtures/video_short-480.webm with 100% similarity]
server/tests/fixtures/video_short.mp4 [moved from server/tests/api/fixtures/video_short.mp4 with 100% similarity]
server/tests/fixtures/video_short.mp4.jpg [moved from server/tests/api/fixtures/video_short.mp4.jpg with 100% similarity]
server/tests/fixtures/video_short.ogv [moved from server/tests/api/fixtures/video_short.ogv with 100% similarity]
server/tests/fixtures/video_short.ogv.jpg [moved from server/tests/api/fixtures/video_short.ogv.jpg with 100% similarity]
server/tests/fixtures/video_short.webm [moved from server/tests/api/fixtures/video_short.webm with 100% similarity]
server/tests/fixtures/video_short.webm.jpg [moved from server/tests/api/fixtures/video_short.webm.jpg with 100% similarity]
server/tests/fixtures/video_short1-preview.webm.jpg [moved from server/tests/api/fixtures/video_short1-preview.webm.jpg with 100% similarity]
server/tests/fixtures/video_short1.webm [moved from server/tests/api/fixtures/video_short1.webm with 100% similarity]
server/tests/fixtures/video_short1.webm.jpg [moved from server/tests/api/fixtures/video_short1.webm.jpg with 100% similarity]
server/tests/fixtures/video_short2.webm [moved from server/tests/api/fixtures/video_short2.webm with 100% similarity]
server/tests/fixtures/video_short2.webm.jpg [moved from server/tests/api/fixtures/video_short2.webm.jpg with 100% similarity]
server/tests/fixtures/video_short3.webm [moved from server/tests/api/fixtures/video_short3.webm with 100% similarity]
server/tests/fixtures/video_short3.webm.jpg [moved from server/tests/api/fixtures/video_short3.webm.jpg with 100% similarity]
server/tests/fixtures/video_short_fake.webm [moved from server/tests/api/fixtures/video_short_fake.webm with 100% similarity]
server/tests/utils/miscs/miscs.ts
server/tests/utils/requests/requests.ts
server/tests/utils/users/users.ts
server/tests/utils/videos/videos.ts

index e8a6ffd196d701c302ee513671ed7157e46a15fb..dba57778de4491257a89cf3f837bdf48444f62e9 100644 (file)
@@ -279,7 +279,7 @@ describe('Test users API validators', function () {
     it('Should fail without an incorrect input file', async function () {
       const fields = {}
       const attaches = {
-        'avatarfile': join(__dirname, '..', 'fixtures', 'video_short.mp4')
+        'avatarfile': join(__dirname, '..', '..', 'fixtures', 'video_short.mp4')
       }
       await makeUploadRequest({ url: server.url, path: path + '/me/avatar/pick', token: server.accessToken, fields, attaches })
     })
@@ -287,7 +287,7 @@ describe('Test users API validators', function () {
     it('Should fail with a big file', async function () {
       const fields = {}
       const attaches = {
-        'avatarfile': join(__dirname, '..', 'fixtures', 'avatar-big.png')
+        'avatarfile': join(__dirname, '..', '..', 'fixtures', 'avatar-big.png')
       }
       await makeUploadRequest({ url: server.url, path: path + '/me/avatar/pick', token: server.accessToken, fields, attaches })
     })
@@ -295,7 +295,7 @@ describe('Test users API validators', function () {
     it('Should succeed with the correct params', async function () {
       const fields = {}
       const attaches = {
-        'avatarfile': join(__dirname, '..', 'fixtures', 'avatar.png')
+        'avatarfile': join(__dirname, '..', '..', 'fixtures', 'avatar.png')
       }
       await makeUploadRequest({
         url: server.url,
index 7b40b91e708dd10ce117504a3b98ef21e6ae5094..bc6c7fc46deadd70a72a2527df07713b973d80d7 100644 (file)
@@ -163,7 +163,7 @@ describe('Test videos API validator', function () {
   describe('When adding a video', function () {
     let baseCorrectParams
     const baseCorrectAttaches = {
-      'videofile': join(__dirname, '..', 'fixtures', 'video_short.webm')
+      'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short.webm')
     }
 
     before(function () {
@@ -313,7 +313,7 @@ describe('Test videos API validator', function () {
     it('Should fail without an incorrect input file', async function () {
       const fields = baseCorrectParams
       const attaches = {
-        'videofile': join(__dirname, '..', 'fixtures', 'video_short_fake.webm')
+        'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short_fake.webm')
       }
       await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
     })
@@ -321,8 +321,8 @@ describe('Test videos API validator', function () {
     it('Should fail with an incorrect thumbnail file', async function () {
       const fields = baseCorrectParams
       const attaches = {
-        'thumbnailfile': join(__dirname, '..', 'fixtures', 'avatar.png'),
-        'videofile': join(__dirname, '..', 'fixtures', 'video_short_fake.webm')
+        'thumbnailfile': join(__dirname, '..', '..', 'fixtures', 'avatar.png'),
+        'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short_fake.webm')
       }
 
       await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
@@ -331,8 +331,8 @@ describe('Test videos API validator', function () {
     it('Should fail with a big thumbnail file', async function () {
       const fields = baseCorrectParams
       const attaches = {
-        'thumbnailfile': join(__dirname, '..', 'fixtures', 'avatar-big.png'),
-        'videofile': join(__dirname, '..', 'fixtures', 'video_short_fake.webm')
+        'thumbnailfile': join(__dirname, '..', '..', 'fixtures', 'avatar-big.png'),
+        'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short_fake.webm')
       }
 
       await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
@@ -341,8 +341,8 @@ describe('Test videos API validator', function () {
     it('Should fail with an incorrect preview file', async function () {
       const fields = baseCorrectParams
       const attaches = {
-        'previewfile': join(__dirname, '..', 'fixtures', 'avatar.png'),
-        'videofile': join(__dirname, '..', 'fixtures', 'video_short_fake.webm')
+        'previewfile': join(__dirname, '..', '..', 'fixtures', 'avatar.png'),
+        'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short_fake.webm')
       }
 
       await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
@@ -351,8 +351,8 @@ describe('Test videos API validator', function () {
     it('Should fail with a big preview file', async function () {
       const fields = baseCorrectParams
       const attaches = {
-        'previewfile': join(__dirname, '..', 'fixtures', 'avatar-big.png'),
-        'videofile': join(__dirname, '..', 'fixtures', 'video_short_fake.webm')
+        'previewfile': join(__dirname, '..', '..', 'fixtures', 'avatar-big.png'),
+        'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short_fake.webm')
       }
 
       await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
@@ -377,7 +377,7 @@ describe('Test videos API validator', function () {
 
       {
         const attaches = immutableAssign(baseCorrectAttaches, {
-          videofile: join(__dirname, '..', 'fixtures', 'video_short.mp4')
+          videofile: join(__dirname, '..', '..', 'fixtures', 'video_short.mp4')
         })
 
         await makeUploadRequest({
@@ -392,7 +392,7 @@ describe('Test videos API validator', function () {
 
       {
         const attaches = immutableAssign(baseCorrectAttaches, {
-          videofile: join(__dirname, '..', 'fixtures', 'video_short.ogv')
+          videofile: join(__dirname, '..', '..', 'fixtures', 'video_short.ogv')
         })
 
         await makeUploadRequest({
@@ -510,7 +510,7 @@ describe('Test videos API validator', function () {
     it('Should fail with an incorrect thumbnail file', async function () {
       const fields = baseCorrectParams
       const attaches = {
-        'thumbnailfile': join(__dirname, '..', 'fixtures', 'avatar.png')
+        'thumbnailfile': join(__dirname, '..', '..', 'fixtures', 'avatar.png')
       }
 
       await makeUploadRequest({
@@ -526,7 +526,7 @@ describe('Test videos API validator', function () {
     it('Should fail with a big thumbnail file', async function () {
       const fields = baseCorrectParams
       const attaches = {
-        'thumbnailfile': join(__dirname, '..', 'fixtures', 'avatar-big.png')
+        'thumbnailfile': join(__dirname, '..', '..', 'fixtures', 'avatar-big.png')
       }
 
       await makeUploadRequest({
@@ -542,7 +542,7 @@ describe('Test videos API validator', function () {
     it('Should fail with an incorrect preview file', async function () {
       const fields = baseCorrectParams
       const attaches = {
-        'previewfile': join(__dirname, '..', 'fixtures', 'avatar.png')
+        'previewfile': join(__dirname, '..', '..', 'fixtures', 'avatar.png')
       }
 
       await makeUploadRequest({
@@ -558,7 +558,7 @@ describe('Test videos API validator', function () {
     it('Should fail with a big preview file', async function () {
       const fields = baseCorrectParams
       const attaches = {
-        'previewfile': join(__dirname, '..', 'fixtures', 'avatar-big.png')
+        'previewfile': join(__dirname, '..', '..', 'fixtures', 'avatar-big.png')
       }
 
       await makeUploadRequest({
index fc7c0cb21c8be23480368a202083190fbdcb988b..5f9a766216da99c1c6abde69fcac9f8c78e82d8d 100644 (file)
@@ -938,7 +938,7 @@ describe('Test multiple servers', function () {
         .field('channelId', '1')
         .field('commentsEnabled', 'true')
 
-      const filePath = join(__dirname, '..', '..', 'api', 'fixtures', 'video_short.webm')
+      const filePath = join(__dirname, '..', '..', 'fixtures', 'video_short.webm')
 
       await req.attach('videofile', filePath)
         .expect(200)
index 251088882addbf9a9abfb8af1dda64602d090d65..372c7e51751a8c23ebc3e4951c5486116a0bacec 100644 (file)
@@ -59,7 +59,7 @@ describe('Test create import video jobs', function () {
 
   it('Should run a import job on video 1 with a lower resolution', async function () {
     const env = getEnvCli(servers[0])
-    await execCLI(`${env} npm run create-import-video-file-job -- -v ${video1UUID} -i server/tests/api/fixtures/video_short-480.webm`)
+    await execCLI(`${env} npm run create-import-video-file-job -- -v ${video1UUID} -i server/tests/fixtures/video_short-480.webm`)
 
     await wait(30000)
 
@@ -83,7 +83,7 @@ describe('Test create import video jobs', function () {
 
   it('Should run a import job on video 2 with the same resolution', async function () {
     const env = getEnvCli(servers[1])
-    await execCLI(`${env} npm run create-import-video-file-job -- -v ${video2UUID} -i server/tests/api/fixtures/video_short.ogv`)
+    await execCLI(`${env} npm run create-import-video-file-job -- -v ${video2UUID} -i server/tests/fixtures/video_short.ogv`)
 
     await wait(30000)
 
index 53cb67baf7f54fcde78fc11b1aef4c68e9c3a694..5e46004a7f48f8a24cac8bfc3961a7268f983483 100644 (file)
@@ -46,7 +46,7 @@ async function testImage (url: string, imageName: string, imagePath: string, ext
 
     const body = res.body
 
-    const data = await readFileBufferPromise(join(__dirname, '..', '..', 'api', 'fixtures', imageName + extension))
+    const data = await readFileBufferPromise(join(__dirname, '..', '..', 'fixtures', imageName + extension))
     const minLength = body.length - ((20 * body.length) / 100)
     const maxLength = body.length + ((20 * body.length) / 100)
 
@@ -63,7 +63,7 @@ function buildAbsoluteFixturePath (path: string) {
     return path
   }
 
-  return join(__dirname, '..', '..', 'api', 'fixtures', path)
+  return join(__dirname, '..', '..', 'fixtures', path)
 }
 
 // ---------------------------------------------------------------------------
index a9b1dff9a28e43a78f1290d4ccda236803028972..b6195089dd169e95711b4e46474fc2e473a7865e 100644 (file)
@@ -1,5 +1,5 @@
 import * as request from 'supertest'
-import { buildAbsoluteFixturePath } from '../'
+import { buildAbsoluteFixturePath } from '../miscs/miscs'
 
 function makeGetRequest (options: {
   url: string,
index d31e57a25675e82e52e4e2eebd35e01b7d70d20a..34d50f7adefc40a2959f05aa34708dc3b01d21f4 100644 (file)
@@ -164,7 +164,7 @@ function updateMyAvatar (options: {
   if (isAbsolute(options.fixture)) {
     filePath = options.fixture
   } else {
-    filePath = join(__dirname, '..', '..', 'api', 'fixtures', options.fixture)
+    filePath = join(__dirname, '..', '..', 'fixtures', options.fixture)
   }
 
   return makeUploadRequest({
index 746b5ca6b558e69383d1f970a95baafcb27131ea..ab0ce12ecc92ba87a797e35feb3c5d2a90b05d1b 100644 (file)
@@ -502,8 +502,6 @@ async function completeVideoCheck (
   expect(dateIsValid(video.updatedAt)).to.be.true
 
   if (attributes.publishedAt) {
-    console.log(attributes.publishedAt)
-    console.log(video.publishedAt)
     expect(video.publishedAt).to.equal(attributes.publishedAt)
   }