aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-16 16:25:53 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-02-18 13:38:09 +0100
commit90a8bd305de4153ec21137a73ff482dcc2e3e19b (patch)
tree2e35b5504ec11bc51579c92a70c77ed3d5ace816 /server/tests/cli
parent684cdacbbd775b5f404dd7b373e02dd21baf5ff0 (diff)
downloadPeerTube-90a8bd305de4153ec21137a73ff482dcc2e3e19b.tar.gz
PeerTube-90a8bd305de4153ec21137a73ff482dcc2e3e19b.tar.zst
PeerTube-90a8bd305de4153ec21137a73ff482dcc2e3e19b.zip
Dissociate video file names and video uuid
Diffstat (limited to 'server/tests/cli')
-rw-r--r--server/tests/cli/create-import-video-file-job.ts16
1 files changed, 2 insertions, 14 deletions
diff --git a/server/tests/cli/create-import-video-file-job.ts b/server/tests/cli/create-import-video-file-job.ts
index dac049fe4..7eaf2c19e 100644
--- a/server/tests/cli/create-import-video-file-job.ts
+++ b/server/tests/cli/create-import-video-file-job.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { VideoDetails } from '../../../shared/models/videos' 5import { VideoFile } from '@shared/models/videos/video-file.model'
6import { 6import {
7 cleanupTests, 7 cleanupTests,
8 doubleFollow, 8 doubleFollow,
@@ -16,7 +16,7 @@ import {
16 uploadVideo 16 uploadVideo
17} from '../../../shared/extra-utils' 17} from '../../../shared/extra-utils'
18import { waitJobs } from '../../../shared/extra-utils/server/jobs' 18import { waitJobs } from '../../../shared/extra-utils/server/jobs'
19import { VideoFile } from '@shared/models/videos/video-file.model' 19import { VideoDetails } from '../../../shared/models/videos'
20 20
21const expect = chai.expect 21const expect = chai.expect
22 22
@@ -62,7 +62,6 @@ describe('Test create import video jobs', function () {
62 62
63 await waitJobs(servers) 63 await waitJobs(servers)
64 64
65 let magnetUri: string
66 for (const server of servers) { 65 for (const server of servers) {
67 const { data: videos } = (await getVideosList(server.url)).body 66 const { data: videos } = (await getVideosList(server.url)).body
68 expect(videos).to.have.lengthOf(2) 67 expect(videos).to.have.lengthOf(2)
@@ -74,9 +73,6 @@ describe('Test create import video jobs', function () {
74 const [ originalVideo, transcodedVideo ] = videoDetail.files 73 const [ originalVideo, transcodedVideo ] = videoDetail.files
75 assertVideoProperties(originalVideo, 720, 'webm', 218910) 74 assertVideoProperties(originalVideo, 720, 'webm', 218910)
76 assertVideoProperties(transcodedVideo, 480, 'webm', 69217) 75 assertVideoProperties(transcodedVideo, 480, 'webm', 69217)
77
78 if (!magnetUri) magnetUri = transcodedVideo.magnetUri
79 else expect(transcodedVideo.magnetUri).to.equal(magnetUri)
80 } 76 }
81 }) 77 })
82 78
@@ -86,7 +82,6 @@ describe('Test create import video jobs', function () {
86 82
87 await waitJobs(servers) 83 await waitJobs(servers)
88 84
89 let magnetUri: string
90 for (const server of servers) { 85 for (const server of servers) {
91 const { data: videos } = (await getVideosList(server.url)).body 86 const { data: videos } = (await getVideosList(server.url)).body
92 expect(videos).to.have.lengthOf(2) 87 expect(videos).to.have.lengthOf(2)
@@ -100,9 +95,6 @@ describe('Test create import video jobs', function () {
100 assertVideoProperties(transcodedVideo420, 480, 'mp4') 95 assertVideoProperties(transcodedVideo420, 480, 'mp4')
101 assertVideoProperties(transcodedVideo320, 360, 'mp4') 96 assertVideoProperties(transcodedVideo320, 360, 'mp4')
102 assertVideoProperties(transcodedVideo240, 240, 'mp4') 97 assertVideoProperties(transcodedVideo240, 240, 'mp4')
103
104 if (!magnetUri) magnetUri = originalVideo.magnetUri
105 else expect(originalVideo.magnetUri).to.equal(magnetUri)
106 } 98 }
107 }) 99 })
108 100
@@ -112,7 +104,6 @@ describe('Test create import video jobs', function () {
112 104
113 await waitJobs(servers) 105 await waitJobs(servers)
114 106
115 let magnetUri: string
116 for (const server of servers) { 107 for (const server of servers) {
117 const { data: videos } = (await getVideosList(server.url)).body 108 const { data: videos } = (await getVideosList(server.url)).body
118 expect(videos).to.have.lengthOf(2) 109 expect(videos).to.have.lengthOf(2)
@@ -124,9 +115,6 @@ describe('Test create import video jobs', function () {
124 const [ video720, video480 ] = videoDetail.files 115 const [ video720, video480 ] = videoDetail.files
125 assertVideoProperties(video720, 720, 'webm', 942961) 116 assertVideoProperties(video720, 720, 'webm', 942961)
126 assertVideoProperties(video480, 480, 'webm', 69217) 117 assertVideoProperties(video480, 480, 'webm', 69217)
127
128 if (!magnetUri) magnetUri = video720.magnetUri
129 else expect(video720.magnetUri).to.equal(magnetUri)
130 } 118 }
131 }) 119 })
132 120