From b488ba1e26b803ac6c637e8b11bdd444ca4c803f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 30 Jul 2020 09:43:12 +0200 Subject: 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 --- server/tests/api/check-params/video-imports.ts | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'server/tests/api/check-params/video-imports.ts') diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts index 3759e47c4..f954ba089 100644 --- a/server/tests/api/check-params/video-imports.ts +++ b/server/tests/api/check-params/video-imports.ts @@ -1,9 +1,8 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import { omit } from 'lodash' import 'mocha' +import { omit } from 'lodash' import { join } from 'path' -import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' import { cleanupTests, createUser, @@ -23,7 +22,8 @@ import { checkBadSortPagination, checkBadStartPagination } from '../../../../shared/extra-utils/requests/check-api-params' -import { getMagnetURI, getYoutubeVideoUrl } from '../../../../shared/extra-utils/videos/video-imports' +import { getMagnetURI, getGoodVideoUrl } from '../../../../shared/extra-utils/videos/video-imports' +import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' describe('Test video imports API validator', function () { const path = '/api/v1/videos/imports' @@ -76,7 +76,7 @@ describe('Test video imports API validator', function () { before(function () { baseCorrectParams = { - targetUrl: getYoutubeVideoUrl(), + targetUrl: getGoodVideoUrl(), name: 'my super name', category: 5, licence: 1, @@ -246,15 +246,13 @@ describe('Test video imports API validator', function () { it('Should succeed with the correct parameters', async function () { this.timeout(30000) - { - await makePostBodyRequest({ - url: server.url, - path, - token: server.accessToken, - fields: baseCorrectParams, - statusCodeExpected: 200 - }) - } + await makePostBodyRequest({ + url: server.url, + path, + token: server.accessToken, + fields: baseCorrectParams, + statusCodeExpected: 200 + }) }) it('Should forbid to import http videos', async function () { -- cgit v1.2.3