diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-16 09:04:35 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 89d241a79c262b9775c233b73cff080043ebb5e6 (patch) | |
tree | cb3b6cb431d25d891ef4e02f66c61d252d17048f /server/tests/api/videos/video-hls.ts | |
parent | d23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff) | |
download | PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip |
Shorter server command names
Diffstat (limited to 'server/tests/api/videos/video-hls.ts')
-rw-r--r-- | server/tests/api/videos/video-hls.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/server/tests/api/videos/video-hls.ts b/server/tests/api/videos/video-hls.ts index d63b81694..9d79f2683 100644 --- a/server/tests/api/videos/video-hls.ts +++ b/server/tests/api/videos/video-hls.ts | |||
@@ -25,7 +25,7 @@ const expect = chai.expect | |||
25 | 25 | ||
26 | async function checkHlsPlaylist (servers: ServerInfo[], videoUUID: string, hlsOnly: boolean, resolutions = [ 240, 360, 480, 720 ]) { | 26 | async function checkHlsPlaylist (servers: ServerInfo[], videoUUID: string, hlsOnly: boolean, resolutions = [ 240, 360, 480, 720 ]) { |
27 | for (const server of servers) { | 27 | for (const server of servers) { |
28 | const videoDetails = await server.videosCommand.get({ id: videoUUID }) | 28 | const videoDetails = await server.videos.get({ id: videoUUID }) |
29 | const baseUrl = `http://${videoDetails.account.host}` | 29 | const baseUrl = `http://${videoDetails.account.host}` |
30 | 30 | ||
31 | expect(videoDetails.streamingPlaylists).to.have.lengthOf(1) | 31 | expect(videoDetails.streamingPlaylists).to.have.lengthOf(1) |
@@ -62,7 +62,7 @@ async function checkHlsPlaylist (servers: ServerInfo[], videoUUID: string, hlsOn | |||
62 | { | 62 | { |
63 | await checkResolutionsInMasterPlaylist({ server, playlistUrl: hlsPlaylist.playlistUrl, resolutions }) | 63 | await checkResolutionsInMasterPlaylist({ server, playlistUrl: hlsPlaylist.playlistUrl, resolutions }) |
64 | 64 | ||
65 | const masterPlaylist = await server.streamingPlaylistsCommand.get({ url: hlsPlaylist.playlistUrl }) | 65 | const masterPlaylist = await server.streamingPlaylists.get({ url: hlsPlaylist.playlistUrl }) |
66 | 66 | ||
67 | for (const resolution of resolutions) { | 67 | for (const resolution of resolutions) { |
68 | expect(masterPlaylist).to.contain(`${resolution}.m3u8`) | 68 | expect(masterPlaylist).to.contain(`${resolution}.m3u8`) |
@@ -72,7 +72,7 @@ async function checkHlsPlaylist (servers: ServerInfo[], videoUUID: string, hlsOn | |||
72 | 72 | ||
73 | { | 73 | { |
74 | for (const resolution of resolutions) { | 74 | for (const resolution of resolutions) { |
75 | const subPlaylist = await server.streamingPlaylistsCommand.get({ | 75 | const subPlaylist = await server.streamingPlaylists.get({ |
76 | url: `${baseUrl}/static/streaming-playlists/hls/${videoUUID}/${resolution}.m3u8` | 76 | url: `${baseUrl}/static/streaming-playlists/hls/${videoUUID}/${resolution}.m3u8` |
77 | }) | 77 | }) |
78 | 78 | ||
@@ -107,7 +107,7 @@ describe('Test HLS videos', function () { | |||
107 | it('Should upload a video and transcode it to HLS', async function () { | 107 | it('Should upload a video and transcode it to HLS', async function () { |
108 | this.timeout(120000) | 108 | this.timeout(120000) |
109 | 109 | ||
110 | const { uuid } = await servers[0].videosCommand.upload({ attributes: { name: 'video 1', fixture: 'video_short.webm' } }) | 110 | const { uuid } = await servers[0].videos.upload({ attributes: { name: 'video 1', fixture: 'video_short.webm' } }) |
111 | videoUUID = uuid | 111 | videoUUID = uuid |
112 | 112 | ||
113 | await waitJobs(servers) | 113 | await waitJobs(servers) |
@@ -118,7 +118,7 @@ describe('Test HLS videos', function () { | |||
118 | it('Should upload an audio file and transcode it to HLS', async function () { | 118 | it('Should upload an audio file and transcode it to HLS', async function () { |
119 | this.timeout(120000) | 119 | this.timeout(120000) |
120 | 120 | ||
121 | const { uuid } = await servers[0].videosCommand.upload({ attributes: { name: 'video audio', fixture: 'sample.ogg' } }) | 121 | const { uuid } = await servers[0].videos.upload({ attributes: { name: 'video audio', fixture: 'sample.ogg' } }) |
122 | videoAudioUUID = uuid | 122 | videoAudioUUID = uuid |
123 | 123 | ||
124 | await waitJobs(servers) | 124 | await waitJobs(servers) |
@@ -129,7 +129,7 @@ describe('Test HLS videos', function () { | |||
129 | it('Should update the video', async function () { | 129 | it('Should update the video', async function () { |
130 | this.timeout(10000) | 130 | this.timeout(10000) |
131 | 131 | ||
132 | await servers[0].videosCommand.update({ id: videoUUID, attributes: { name: 'video 1 updated' } }) | 132 | await servers[0].videos.update({ id: videoUUID, attributes: { name: 'video 1 updated' } }) |
133 | 133 | ||
134 | await waitJobs(servers) | 134 | await waitJobs(servers) |
135 | 135 | ||
@@ -139,14 +139,14 @@ describe('Test HLS videos', function () { | |||
139 | it('Should delete videos', async function () { | 139 | it('Should delete videos', async function () { |
140 | this.timeout(10000) | 140 | this.timeout(10000) |
141 | 141 | ||
142 | await servers[0].videosCommand.remove({ id: videoUUID }) | 142 | await servers[0].videos.remove({ id: videoUUID }) |
143 | await servers[0].videosCommand.remove({ id: videoAudioUUID }) | 143 | await servers[0].videos.remove({ id: videoAudioUUID }) |
144 | 144 | ||
145 | await waitJobs(servers) | 145 | await waitJobs(servers) |
146 | 146 | ||
147 | for (const server of servers) { | 147 | for (const server of servers) { |
148 | await server.videosCommand.get({ id: videoUUID, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) | 148 | await server.videos.get({ id: videoUUID, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) |
149 | await server.videosCommand.get({ id: videoAudioUUID, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) | 149 | await server.videos.get({ id: videoAudioUUID, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) |
150 | } | 150 | } |
151 | }) | 151 | }) |
152 | 152 | ||
@@ -192,7 +192,7 @@ describe('Test HLS videos', function () { | |||
192 | describe('With only HLS enabled', function () { | 192 | describe('With only HLS enabled', function () { |
193 | 193 | ||
194 | before(async function () { | 194 | before(async function () { |
195 | await servers[0].configCommand.updateCustomSubConfig({ | 195 | await servers[0].config.updateCustomSubConfig({ |
196 | newConfig: { | 196 | newConfig: { |
197 | transcoding: { | 197 | transcoding: { |
198 | enabled: true, | 198 | enabled: true, |