]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/tests/utils/videos/video-imports.ts
Add tests regarding video import
[github/Chocobozzz/PeerTube.git] / server / tests / utils / videos / video-imports.ts
CommitLineData
590fb506
C
1import { VideoImportCreate } from '../../../../shared/models/videos'
2import { makeGetRequest, makePostBodyRequest } from '..'
3
4function getYoutubeVideoUrl () {
5 return 'https://youtu.be/msX3jv1XdvM'
6}
7
8function importVideo (url: string, token: string, attributes: VideoImportCreate) {
9 const path = '/api/v1/videos/imports'
10
11 return makePostBodyRequest({
12 url,
13 path,
14 token,
15 fields: attributes,
16 statusCodeExpected: 200
17 })
18}
19
20function getMyVideoImports (url: string, token: string) {
21 const path = '/api/v1/users/me/videos/imports'
22
23 return makeGetRequest({
24 url,
25 path,
26 token,
27 statusCodeExpected: 200
28 })
29}
30
31// ---------------------------------------------------------------------------
32
33export {
34 getYoutubeVideoUrl,
35 importVideo,
36 getMyVideoImports
37}