diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-08 21:16:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 21:16:10 +0100 |
commit | f2eb23cd87cf32b8fe545178143b5f49e06a58da (patch) | |
tree | af7d59945af70e28fd85047e2c688c59a908f548 /server/tests/api/videos/video-hls.ts | |
parent | c977fd3ec931c059111ddb2b8d6ddbb20b6b99a1 (diff) | |
download | PeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.tar.gz PeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.tar.zst PeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.zip |
emit more specific status codes on video upload (#3423)
- reduce http status codes list to potentially useful codes
- convert more codes to typed ones
- factorize html generator for error responses
Diffstat (limited to 'server/tests/api/videos/video-hls.ts')
-rw-r--r-- | server/tests/api/videos/video-hls.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/tests/api/videos/video-hls.ts b/server/tests/api/videos/video-hls.ts index 3a65cc1d2..f3dbbb114 100644 --- a/server/tests/api/videos/video-hls.ts +++ b/server/tests/api/videos/video-hls.ts | |||
@@ -26,6 +26,7 @@ import { | |||
26 | import { VideoDetails } from '../../../../shared/models/videos' | 26 | import { VideoDetails } from '../../../../shared/models/videos' |
27 | import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type' | 27 | import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type' |
28 | import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' | 28 | import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' |
29 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
29 | 30 | ||
30 | const expect = chai.expect | 31 | const expect = chai.expect |
31 | 32 | ||
@@ -57,8 +58,8 @@ async function checkHlsPlaylist (servers: ServerInfo[], videoUUID: string, hlsOn | |||
57 | ) | 58 | ) |
58 | expect(file.resolution.label).to.equal(resolution + 'p') | 59 | expect(file.resolution.label).to.equal(resolution + 'p') |
59 | 60 | ||
60 | await makeRawRequest(file.torrentUrl, 200) | 61 | await makeRawRequest(file.torrentUrl, HttpStatusCode.OK_200) |
61 | await makeRawRequest(file.fileUrl, 200) | 62 | await makeRawRequest(file.fileUrl, HttpStatusCode.OK_200) |
62 | 63 | ||
63 | const torrent = await webtorrentAdd(file.magnetUri, true) | 64 | const torrent = await webtorrentAdd(file.magnetUri, true) |
64 | expect(torrent.files).to.be.an('array') | 65 | expect(torrent.files).to.be.an('array') |
@@ -144,8 +145,8 @@ describe('Test HLS videos', function () { | |||
144 | await waitJobs(servers) | 145 | await waitJobs(servers) |
145 | 146 | ||
146 | for (const server of servers) { | 147 | for (const server of servers) { |
147 | await getVideo(server.url, videoUUID, 404) | 148 | await getVideo(server.url, videoUUID, HttpStatusCode.NOT_FOUND_404) |
148 | await getVideo(server.url, videoAudioUUID, 404) | 149 | await getVideo(server.url, videoAudioUUID, HttpStatusCode.NOT_FOUND_404) |
149 | } | 150 | } |
150 | }) | 151 | }) |
151 | 152 | ||