aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/users.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-07-30 09:43:12 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-07-31 11:32:04 +0200
commitb488ba1e26b803ac6c637e8b11bdd444ca4c803f (patch)
tree0a9ce01fcfb26ecddd8a0dccf997514818b8a72f /server/tests/api/check-params/users.ts
parentb9fe9a7ffdf80d81c5580ccccfeb989051fd9d8a (diff)
downloadPeerTube-b488ba1e26b803ac6c637e8b11bdd444ca4c803f.tar.gz
PeerTube-b488ba1e26b803ac6c637e8b11bdd444ca4c803f.tar.zst
PeerTube-b488ba1e26b803ac6c637e8b11bdd444ca4c803f.zip
Don't rely on youtube for tests
Use another import URL when possible, and disable import tests when we want to do a youtube import test
Diffstat (limited to 'server/tests/api/check-params/users.ts')
-rw-r--r--server/tests/api/check-params/users.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts
index 2fea2cbd5..3e53c445d 100644
--- a/server/tests/api/check-params/users.ts
+++ b/server/tests/api/check-params/users.ts
@@ -1,10 +1,10 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import { omit } from 'lodash'
4import 'mocha' 3import 'mocha'
4import { expect } from 'chai'
5import { omit } from 'lodash'
5import { join } from 'path' 6import { join } from 'path'
6import { User, UserRole, VideoImport, VideoImportState } from '../../../../shared' 7import { User, UserRole, VideoImport, VideoImportState } from '../../../../shared'
7
8import { 8import {
9 addVideoChannel, 9 addVideoChannel,
10 blockUser, 10 blockUser,
@@ -31,17 +31,16 @@ import {
31 uploadVideo, 31 uploadVideo,
32 userLogin 32 userLogin
33} from '../../../../shared/extra-utils' 33} from '../../../../shared/extra-utils'
34import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email'
34import { 35import {
35 checkBadCountPagination, 36 checkBadCountPagination,
36 checkBadSortPagination, 37 checkBadSortPagination,
37 checkBadStartPagination 38 checkBadStartPagination
38} from '../../../../shared/extra-utils/requests/check-api-params' 39} from '../../../../shared/extra-utils/requests/check-api-params'
39import { getMagnetURI, getMyVideoImports, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
40import { VideoPrivacy } from '../../../../shared/models/videos'
41import { waitJobs } from '../../../../shared/extra-utils/server/jobs' 40import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
42import { expect } from 'chai' 41import { getMagnetURI, getMyVideoImports, getGoodVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
43import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' 42import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
44import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' 43import { VideoPrivacy } from '../../../../shared/models/videos'
45 44
46describe('Test users API validators', function () { 45describe('Test users API validators', function () {
47 const path = '/api/v1/users/' 46 const path = '/api/v1/users/'
@@ -1047,7 +1046,7 @@ describe('Test users API validators', function () {
1047 channelId: 1, 1046 channelId: 1,
1048 privacy: VideoPrivacy.PUBLIC 1047 privacy: VideoPrivacy.PUBLIC
1049 } 1048 }
1050 await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { targetUrl: getYoutubeVideoUrl() })) 1049 await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { targetUrl: getGoodVideoUrl() }))
1051 await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { magnetUri: getMagnetURI() })) 1050 await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { magnetUri: getMagnetURI() }))
1052 await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { torrentfile: 'video-720p.torrent' as any })) 1051 await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { torrentfile: 'video-720p.torrent' as any }))
1053 1052