]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/utils/videos.ts
Client: handle multiple file resolutions
[github/Chocobozzz/PeerTube.git] / server / tests / utils / videos.ts
index 83271becabb95ffddcae5dabdb8d4fd44fbbf0b5..7f8bd39c094d2be5b61372fc3a3d80afc98f6228 100644 (file)
@@ -163,7 +163,7 @@ async function testVideoImage (url: string, imageName: string, imagePath: string
 }
 
 function uploadVideo (url: string, accessToken: string, videoAttributesArg: VideoAttributes, specialStatus = 204) {
-  const path = '/api/v1/videos'
+  const path = '/api/v1/videos/upload'
 
   // Default attributes
   let attributes = {
@@ -238,9 +238,10 @@ function rateVideo (url: string, accessToken: string, id: number, rating: string
           .expect(specialStatus)
 }
 
-function parseTorrentVideo (server: ServerInfo, videoUUID: string) {
+function parseTorrentVideo (server: ServerInfo, videoUUID: string, resolutionLabel: string) {
   return new Promise<any>((res, rej) => {
-    const torrentPath = join(__dirname, '..', '..', '..', 'test' + server.serverNumber, 'torrents', videoUUID + '.torrent')
+    const torrentName = videoUUID + '-' + resolutionLabel + '.torrent'
+    const torrentPath = join(__dirname, '..', '..', '..', 'test' + server.serverNumber, 'torrents', torrentName)
     readFile(torrentPath, (err, data) => {
       if (err) return rej(err)