diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-15 10:02:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | d23dd9fbfc4d26026352c10f81d2795ceaf2908a (patch) | |
tree | da82286d423c5e834a1ee2dcd5970076b8263cf1 /server/tests/api/redundancy/manage-redundancy.ts | |
parent | 7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0 (diff) | |
download | PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.gz PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.zst PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.zip |
Introduce videos command
Diffstat (limited to 'server/tests/api/redundancy/manage-redundancy.ts')
-rw-r--r-- | server/tests/api/redundancy/manage-redundancy.ts | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/server/tests/api/redundancy/manage-redundancy.ts b/server/tests/api/redundancy/manage-redundancy.ts index 03857f512..efb60dc56 100644 --- a/server/tests/api/redundancy/manage-redundancy.ts +++ b/server/tests/api/redundancy/manage-redundancy.ts | |||
@@ -6,12 +6,9 @@ import { | |||
6 | cleanupTests, | 6 | cleanupTests, |
7 | doubleFollow, | 7 | doubleFollow, |
8 | flushAndRunMultipleServers, | 8 | flushAndRunMultipleServers, |
9 | getLocalIdByUUID, | ||
10 | RedundancyCommand, | 9 | RedundancyCommand, |
11 | ServerInfo, | 10 | ServerInfo, |
12 | setAccessTokensToServers, | 11 | setAccessTokensToServers, |
13 | uploadVideo, | ||
14 | uploadVideoAndGetId, | ||
15 | waitJobs | 12 | waitJobs |
16 | } from '@shared/extra-utils' | 13 | } from '@shared/extra-utils' |
17 | import { VideoPrivacy, VideoRedundanciesTarget } from '@shared/models' | 14 | import { VideoPrivacy, VideoRedundanciesTarget } from '@shared/models' |
@@ -59,13 +56,13 @@ describe('Test manage videos redundancy', function () { | |||
59 | commands = servers.map(s => s.redundancyCommand) | 56 | commands = servers.map(s => s.redundancyCommand) |
60 | 57 | ||
61 | { | 58 | { |
62 | const res = await uploadVideo(servers[1].url, servers[1].accessToken, { name: 'video 1 server 2' }) | 59 | const { uuid } = await servers[1].videosCommand.upload({ attributes: { name: 'video 1 server 2' } }) |
63 | video1Server2UUID = res.body.video.uuid | 60 | video1Server2UUID = uuid |
64 | } | 61 | } |
65 | 62 | ||
66 | { | 63 | { |
67 | const res = await uploadVideo(servers[1].url, servers[1].accessToken, { name: 'video 2 server 2' }) | 64 | const { uuid } = await servers[1].videosCommand.upload({ attributes: { name: 'video 2 server 2' } }) |
68 | video2Server2UUID = res.body.video.uuid | 65 | video2Server2UUID = uuid |
69 | } | 66 | } |
70 | 67 | ||
71 | await waitJobs(servers) | 68 | await waitJobs(servers) |
@@ -206,9 +203,9 @@ describe('Test manage videos redundancy', function () { | |||
206 | it('Should manually add a redundancy and list it', async function () { | 203 | it('Should manually add a redundancy and list it', async function () { |
207 | this.timeout(120000) | 204 | this.timeout(120000) |
208 | 205 | ||
209 | const uuid = (await uploadVideoAndGetId({ server: servers[1], videoName: 'video 3 server 2', privacy: VideoPrivacy.UNLISTED })).uuid | 206 | const uuid = (await servers[1].videosCommand.quickUpload({ name: 'video 3 server 2', privacy: VideoPrivacy.UNLISTED })).uuid |
210 | await waitJobs(servers) | 207 | await waitJobs(servers) |
211 | const videoId = await getLocalIdByUUID(servers[0].url, uuid) | 208 | const videoId = await servers[0].videosCommand.getId({ uuid }) |
212 | 209 | ||
213 | await commands[0].addVideo({ videoId }) | 210 | await commands[0].addVideo({ videoId }) |
214 | 211 | ||