aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-03 16:23:45 +0200
committerChocobozzz <me@florianbigard.com>2018-08-06 11:19:16 +0200
commit590fb5069038e69898123bb795f789683216d837 (patch)
treeddb3d1830b7d64ebae214dd65a94dd3d16324819 /server/tests/utils/videos
parent5d08a6a74e83f2e4dfe2f3ba7f5a39371e1bc89e (diff)
downloadPeerTube-590fb5069038e69898123bb795f789683216d837.tar.gz
PeerTube-590fb5069038e69898123bb795f789683216d837.tar.zst
PeerTube-590fb5069038e69898123bb795f789683216d837.zip
Add tests regarding video import
Diffstat (limited to 'server/tests/utils/videos')
-rw-r--r--server/tests/utils/videos/video-imports.ts37
1 files changed, 37 insertions, 0 deletions
diff --git a/server/tests/utils/videos/video-imports.ts b/server/tests/utils/videos/video-imports.ts
new file mode 100644
index 000000000..e0f916990
--- /dev/null
+++ b/server/tests/utils/videos/video-imports.ts
@@ -0,0 +1,37 @@
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}