aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/video-imports.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-07 11:51:09 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:17 +0200
commit65e6e2602c0d5521f3a6740f7469bb92830ecb53 (patch)
treef89024ffff1dafb0281ee2fe028e89b95101bd44 /server/tests/api/check-params/video-imports.ts
parentbc8090411ddaa8d742ce4de3c83f9dba7bc18e2a (diff)
downloadPeerTube-65e6e2602c0d5521f3a6740f7469bb92830ecb53.tar.gz
PeerTube-65e6e2602c0d5521f3a6740f7469bb92830ecb53.tar.zst
PeerTube-65e6e2602c0d5521f3a6740f7469bb92830ecb53.zip
Introduce config command
Diffstat (limited to 'server/tests/api/check-params/video-imports.ts')
-rw-r--r--server/tests/api/check-params/video-imports.ts53
1 files changed, 27 insertions, 26 deletions
diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts
index a27b624d0..dae3860ef 100644
--- a/server/tests/api/check-params/video-imports.ts
+++ b/server/tests/api/check-params/video-imports.ts
@@ -2,9 +2,12 @@
2 2
3import 'mocha' 3import 'mocha'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 5import { HttpStatusCode } from '@shared/core-utils'
6import { 6import {
7 buildAbsoluteFixturePath, 7 buildAbsoluteFixturePath,
8 checkBadCountPagination,
9 checkBadSortPagination,
10 checkBadStartPagination,
8 cleanupTests, 11 cleanupTests,
9 createUser, 12 createUser,
10 flushAndRunServer, 13 flushAndRunServer,
@@ -15,16 +18,10 @@ import {
15 makeUploadRequest, 18 makeUploadRequest,
16 ServerInfo, 19 ServerInfo,
17 setAccessTokensToServers, 20 setAccessTokensToServers,
18 updateCustomSubConfig,
19 userLogin 21 userLogin
20} from '../../../../shared/extra-utils' 22} from '@shared/extra-utils'
21import { 23import { getGoodVideoUrl, getMagnetURI } from '@shared/extra-utils/videos/video-imports'
22 checkBadCountPagination, 24import { VideoPrivacy } from '@shared/models'
23 checkBadSortPagination,
24 checkBadStartPagination
25} from '../../../../shared/extra-utils/requests/check-api-params'
26import { getGoodVideoUrl, getMagnetURI } from '../../../../shared/extra-utils/videos/video-imports'
27import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum'
28 25
29describe('Test video imports API validator', function () { 26describe('Test video imports API validator', function () {
30 const path = '/api/v1/videos/imports' 27 const path = '/api/v1/videos/imports'
@@ -263,14 +260,16 @@ describe('Test video imports API validator', function () {
263 }) 260 })
264 261
265 it('Should forbid to import http videos', async function () { 262 it('Should forbid to import http videos', async function () {
266 await updateCustomSubConfig(server.url, server.accessToken, { 263 await server.configCommand.updateCustomSubConfig({
267 import: { 264 newConfig: {
268 videos: { 265 import: {
269 http: { 266 videos: {
270 enabled: false 267 http: {
271 }, 268 enabled: false
272 torrent: { 269 },
273 enabled: true 270 torrent: {
271 enabled: true
272 }
274 } 273 }
275 } 274 }
276 } 275 }
@@ -286,14 +285,16 @@ describe('Test video imports API validator', function () {
286 }) 285 })
287 286
288 it('Should forbid to import torrent videos', async function () { 287 it('Should forbid to import torrent videos', async function () {
289 await updateCustomSubConfig(server.url, server.accessToken, { 288 await server.configCommand.updateCustomSubConfig({
290 import: { 289 newConfig: {
291 videos: { 290 import: {
292 http: { 291 videos: {
293 enabled: true 292 http: {
294 }, 293 enabled: true
295 torrent: { 294 },
296 enabled: false 295 torrent: {
296 enabled: false
297 }
297 } 298 }
298 } 299 }
299 } 300 }