From 94565d52bb2883e09f16d1363170ac9c0dccb7a1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 15 Apr 2019 15:26:15 +0200 Subject: Shared utils -> extra-utils Because they need dev dependencies --- server/tests/api/activitypub/client.ts | 2 +- server/tests/api/activitypub/fetch.ts | 2 +- server/tests/api/activitypub/helpers.ts | 2 +- server/tests/api/activitypub/refresher.ts | 4 ++-- server/tests/api/activitypub/security.ts | 4 ++-- server/tests/api/check-params/accounts.ts | 6 +++--- server/tests/api/check-params/blocklist.ts | 4 ++-- server/tests/api/check-params/config.ts | 2 +- server/tests/api/check-params/contact-form.ts | 10 +++++----- server/tests/api/check-params/debug.ts | 4 ++-- server/tests/api/check-params/follows.ts | 4 ++-- server/tests/api/check-params/jobs.ts | 6 +++--- server/tests/api/check-params/logs.ts | 4 ++-- server/tests/api/check-params/redundancy.ts | 2 +- server/tests/api/check-params/search.ts | 4 ++-- server/tests/api/check-params/services.ts | 2 +- .../tests/api/check-params/user-notifications.ts | 4 ++-- .../tests/api/check-params/user-subscriptions.ts | 6 +++--- server/tests/api/check-params/users.ts | 8 ++++---- server/tests/api/check-params/video-abuses.ts | 4 ++-- server/tests/api/check-params/video-blacklist.ts | 4 ++-- server/tests/api/check-params/video-captions.ts | 4 ++-- server/tests/api/check-params/video-channels.ts | 4 ++-- server/tests/api/check-params/video-comments.ts | 6 +++--- server/tests/api/check-params/video-imports.ts | 6 +++--- server/tests/api/check-params/video-playlists.ts | 4 ++-- server/tests/api/check-params/videos-filter.ts | 2 +- server/tests/api/check-params/videos-history.ts | 2 +- server/tests/api/check-params/videos.ts | 6 +++--- .../tests/api/notifications/user-notifications.ts | 22 +++++++++++----------- server/tests/api/redundancy/redundancy.ts | 8 ++++---- .../search/search-activitypub-video-channels.ts | 6 +++--- .../tests/api/search/search-activitypub-videos.ts | 4 ++-- server/tests/api/search/search-videos.ts | 2 +- server/tests/api/server/config.ts | 2 +- server/tests/api/server/contact-form.ts | 8 ++++---- server/tests/api/server/email.ts | 6 +++--- server/tests/api/server/follow-constraints.ts | 8 ++++---- server/tests/api/server/follows-moderation.ts | 6 +++--- server/tests/api/server/follows.ts | 22 +++++++++++----------- server/tests/api/server/handle-down.ts | 8 ++++---- server/tests/api/server/jobs.ts | 12 ++++++------ server/tests/api/server/logs.ts | 8 ++++---- server/tests/api/server/no-client.ts | 4 ++-- server/tests/api/server/reverse-proxy.ts | 4 ++-- server/tests/api/server/stats.ts | 10 +++++----- server/tests/api/server/tracker.ts | 4 ++-- server/tests/api/users/blocklist.ts | 12 ++++++------ server/tests/api/users/user-subscriptions.ts | 10 +++++----- server/tests/api/users/users-multiple-servers.ts | 17 ++++++++++++----- server/tests/api/users/users-verification.ts | 8 ++++---- server/tests/api/users/users.ts | 8 ++++---- server/tests/api/videos/multiple-servers.ts | 6 +++--- server/tests/api/videos/services.ts | 4 ++-- server/tests/api/videos/single-server.ts | 2 +- server/tests/api/videos/video-abuse.ts | 6 +++--- server/tests/api/videos/video-blacklist.ts | 6 +++--- server/tests/api/videos/video-captions.ts | 13 +++++++++---- server/tests/api/videos/video-change-ownership.ts | 4 ++-- server/tests/api/videos/video-channels.ts | 6 +++--- server/tests/api/videos/video-comments.ts | 6 +++--- server/tests/api/videos/video-description.ts | 6 +++--- server/tests/api/videos/video-hls.ts | 2 +- server/tests/api/videos/video-imports.ts | 6 +++--- server/tests/api/videos/video-nsfw.ts | 10 +++++----- server/tests/api/videos/video-playlists.ts | 2 +- server/tests/api/videos/video-privacy.ts | 12 ++++++------ server/tests/api/videos/video-schedule-update.ts | 4 ++-- server/tests/api/videos/video-transcoder.ts | 4 ++-- server/tests/api/videos/videos-filter.ts | 2 +- server/tests/api/videos/videos-history.ts | 4 ++-- server/tests/api/videos/videos-overview.ts | 4 ++-- server/tests/api/videos/videos-views-cleaner.ts | 6 +++--- server/tests/cli/create-import-video-file-job.ts | 4 ++-- server/tests/cli/create-transcoding-job.ts | 4 ++-- server/tests/cli/optimize-old-videos.ts | 4 ++-- server/tests/cli/peertube.ts | 2 +- server/tests/cli/reset-password.ts | 2 +- server/tests/cli/update-host.ts | 8 ++++---- server/tests/client.ts | 2 +- server/tests/feeds/feeds.ts | 6 +++--- server/tests/helpers/request.ts | 2 +- server/tests/misc-endpoints.ts | 2 +- server/tests/real-world/populate-database.ts | 2 +- server/tests/real-world/real-world.ts | 4 ++-- server/tools/peertube-get-access-token.ts | 2 +- server/tools/peertube-import-videos.ts | 2 +- server/tools/peertube-upload.ts | 4 ++-- 88 files changed, 249 insertions(+), 237 deletions(-) (limited to 'server') diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index 6d90d8643..52e7e27f8 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts @@ -11,7 +11,7 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' const expect = chai.expect diff --git a/server/tests/api/activitypub/fetch.ts b/server/tests/api/activitypub/fetch.ts index 9cbc7dd84..f9dba3418 100644 --- a/server/tests/api/activitypub/fetch.ts +++ b/server/tests/api/activitypub/fetch.ts @@ -17,7 +17,7 @@ import { uploadVideo, userLogin, waitJobs -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import * as chai from 'chai' import { Video } from '../../../../shared/models/videos' diff --git a/server/tests/api/activitypub/helpers.ts b/server/tests/api/activitypub/helpers.ts index ac6e755c3..365d0e1ae 100644 --- a/server/tests/api/activitypub/helpers.ts +++ b/server/tests/api/activitypub/helpers.ts @@ -2,7 +2,7 @@ import 'mocha' import { expect } from 'chai' -import { buildRequestStub } from '../../../../shared/utils/miscs/stubs' +import { buildRequestStub } from '../../../../shared/extra-utils/miscs/stubs' import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../../../helpers/peertube-crypto' import { cloneDeep } from 'lodash' import { buildSignedActivity } from '../../../helpers/activitypub' diff --git a/server/tests/api/activitypub/refresher.ts b/server/tests/api/activitypub/refresher.ts index 665a9f9f0..7b08b1dab 100644 --- a/server/tests/api/activitypub/refresher.ts +++ b/server/tests/api/activitypub/refresher.ts @@ -20,8 +20,8 @@ import { uploadVideoAndGetId, wait, waitJobs -} from '../../../../shared/utils' -import { getAccount } from '../../../../shared/utils/users/accounts' +} from '../../../../shared/extra-utils' +import { getAccount } from '../../../../shared/extra-utils/users/accounts' import { VideoPlaylistPrivacy } from '../../../../shared/models/videos' describe('Test AP refresher', function () { diff --git a/server/tests/api/activitypub/security.ts b/server/tests/api/activitypub/security.ts index 2c55876ba..2346e9c8e 100644 --- a/server/tests/api/activitypub/security.ts +++ b/server/tests/api/activitypub/security.ts @@ -9,12 +9,12 @@ import { killallServers, ServerInfo, setActorField -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { HTTP_SIGNATURE } from '../../../initializers/constants' import { buildDigest, buildGlobalHeaders } from '../../../lib/job-queue/handlers/utils/activitypub-http-utils' import * as chai from 'chai' import { activityPubContextify, buildSignedActivity } from '../../../helpers/activitypub' -import { makeFollowRequest, makePOSTAPRequest } from '../../../../shared/utils/requests/activitypub' +import { makeFollowRequest, makePOSTAPRequest } from '../../../../shared/extra-utils/requests/activitypub' const expect = chai.expect diff --git a/server/tests/api/check-params/accounts.ts b/server/tests/api/check-params/accounts.ts index 68f9519c6..4c145c41d 100644 --- a/server/tests/api/check-params/accounts.ts +++ b/server/tests/api/check-params/accounts.ts @@ -2,13 +2,13 @@ import 'mocha' -import { flushTests, killallServers, runServer, ServerInfo } from '../../../../shared/utils' +import { flushTests, killallServers, runServer, ServerInfo } from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' -import { getAccount } from '../../../../shared/utils/users/accounts' +} from '../../../../shared/extra-utils/requests/check-api-params' +import { getAccount } from '../../../../shared/extra-utils/users/accounts' describe('Test accounts API validators', function () { const path = '/api/v1/accounts/' diff --git a/server/tests/api/check-params/blocklist.ts b/server/tests/api/check-params/blocklist.ts index 62a2c2a52..6c7351d38 100644 --- a/server/tests/api/check-params/blocklist.ts +++ b/server/tests/api/check-params/blocklist.ts @@ -13,12 +13,12 @@ import { makePostBodyRequest, ServerInfo, setAccessTokensToServers, userLogin -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' +} from '../../../../shared/extra-utils/requests/check-api-params' describe('Test blocklist API validators', function () { let servers: ServerInfo[] diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index 3bcb015d9..ba07552cf 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts @@ -7,7 +7,7 @@ import { CustomConfig } from '../../../../shared/models/server/custom-config.mod import { createUser, flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePutBodyRequest, runServer, ServerInfo, setAccessTokensToServers, userLogin, immutableAssign -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' describe('Test config API validators', function () { const path = '/api/v1/config/custom' diff --git a/server/tests/api/check-params/contact-form.ts b/server/tests/api/check-params/contact-form.ts index c7e014b1f..9ba6136aa 100644 --- a/server/tests/api/check-params/contact-form.ts +++ b/server/tests/api/check-params/contact-form.ts @@ -10,15 +10,15 @@ import { runServer, ServerInfo, setAccessTokensToServers -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' -import { getAccount } from '../../../../shared/utils/users/accounts' -import { sendContactForm } from '../../../../shared/utils/server/contact-form' -import { MockSmtpServer } from '../../../../shared/utils/miscs/email' +} from '../../../../shared/extra-utils/requests/check-api-params' +import { getAccount } from '../../../../shared/extra-utils/users/accounts' +import { sendContactForm } from '../../../../shared/extra-utils/server/contact-form' +import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' describe('Test contact form API validators', function () { let server: ServerInfo diff --git a/server/tests/api/check-params/debug.ts b/server/tests/api/check-params/debug.ts index da94beffe..8ba7e0430 100644 --- a/server/tests/api/check-params/debug.ts +++ b/server/tests/api/check-params/debug.ts @@ -10,8 +10,8 @@ import { ServerInfo, setAccessTokensToServers, userLogin -} from '../../../../shared/utils' -import { makeGetRequest } from '../../../../shared/utils/requests/requests' +} from '../../../../shared/extra-utils' +import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests' describe('Test debug API validators', function () { const path = '/api/v1/server/debug' diff --git a/server/tests/api/check-params/follows.ts b/server/tests/api/check-params/follows.ts index 5bb337682..e75631312 100644 --- a/server/tests/api/check-params/follows.ts +++ b/server/tests/api/check-params/follows.ts @@ -5,12 +5,12 @@ import 'mocha' import { createUser, flushTests, killallServers, makeDeleteRequest, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, userLogin -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' +} from '../../../../shared/extra-utils/requests/check-api-params' describe('Test server follows API validators', function () { let server: ServerInfo diff --git a/server/tests/api/check-params/jobs.ts b/server/tests/api/check-params/jobs.ts index 5fb2b9606..682406e87 100644 --- a/server/tests/api/check-params/jobs.ts +++ b/server/tests/api/check-params/jobs.ts @@ -10,13 +10,13 @@ import { ServerInfo, setAccessTokensToServers, userLogin -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' -import { makeGetRequest } from '../../../../shared/utils/requests/requests' +} from '../../../../shared/extra-utils/requests/check-api-params' +import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests' describe('Test jobs API validators', function () { const path = '/api/v1/jobs/failed' diff --git a/server/tests/api/check-params/logs.ts b/server/tests/api/check-params/logs.ts index 9bc6ac244..0948f7c5e 100644 --- a/server/tests/api/check-params/logs.ts +++ b/server/tests/api/check-params/logs.ts @@ -10,8 +10,8 @@ import { ServerInfo, setAccessTokensToServers, userLogin -} from '../../../../shared/utils' -import { makeGetRequest } from '../../../../shared/utils/requests/requests' +} from '../../../../shared/extra-utils' +import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests' describe('Test logs API validators', function () { const path = '/api/v1/server/logs' diff --git a/server/tests/api/check-params/redundancy.ts b/server/tests/api/check-params/redundancy.ts index d14e35cf2..93b905fea 100644 --- a/server/tests/api/check-params/redundancy.ts +++ b/server/tests/api/check-params/redundancy.ts @@ -12,7 +12,7 @@ import { ServerInfo, setAccessTokensToServers, userLogin -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' describe('Test server redundancy API validators', function () { let servers: ServerInfo[] diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.ts index 7b7e07784..1fcdedd90 100644 --- a/server/tests/api/check-params/search.ts +++ b/server/tests/api/check-params/search.ts @@ -2,12 +2,12 @@ import 'mocha' -import { flushTests, immutableAssign, killallServers, makeGetRequest, runServer, ServerInfo } from '../../../../shared/utils' +import { flushTests, immutableAssign, killallServers, makeGetRequest, runServer, ServerInfo } from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' +} from '../../../../shared/extra-utils/requests/check-api-params' describe('Test videos API validator', function () { let server: ServerInfo diff --git a/server/tests/api/check-params/services.ts b/server/tests/api/check-params/services.ts index 28591af9d..813bc7e36 100644 --- a/server/tests/api/check-params/services.ts +++ b/server/tests/api/check-params/services.ts @@ -10,7 +10,7 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' describe('Test services API validators', function () { let server: ServerInfo diff --git a/server/tests/api/check-params/user-notifications.ts b/server/tests/api/check-params/user-notifications.ts index 4b75f6920..c56328406 100644 --- a/server/tests/api/check-params/user-notifications.ts +++ b/server/tests/api/check-params/user-notifications.ts @@ -14,12 +14,12 @@ import { ServerInfo, setAccessTokensToServers, wait -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' +} from '../../../../shared/extra-utils/requests/check-api-params' import { UserNotificationSetting, UserNotificationSettingValue } from '../../../../shared/models/users' describe('Test user notifications API validators', function () { diff --git a/server/tests/api/check-params/user-subscriptions.ts b/server/tests/api/check-params/user-subscriptions.ts index a18e1a43b..d33b3bca6 100644 --- a/server/tests/api/check-params/user-subscriptions.ts +++ b/server/tests/api/check-params/user-subscriptions.ts @@ -13,14 +13,14 @@ import { ServerInfo, setAccessTokensToServers, userLogin -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils/requests/check-api-params' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' describe('Test user subscriptions API validators', function () { const path = '/api/v1/users/me/subscriptions' diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index b5c812e8f..b62806554 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts @@ -9,15 +9,15 @@ import { createUser, flushTests, getMyUserInformation, getMyUserVideoRating, getUsersList, immutableAssign, killallServers, makeGetRequest, makePostBodyRequest, makeUploadRequest, makePutBodyRequest, registerUser, removeUser, runServer, ServerInfo, setAccessTokensToServers, updateUser, uploadVideo, userLogin, deleteMe, unblockUser, blockUser -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' -import { getMagnetURI, getMyVideoImports, getYoutubeVideoUrl, importVideo } from '../../../../shared/utils/videos/video-imports' +} from '../../../../shared/extra-utils/requests/check-api-params' +import { getMagnetURI, getMyVideoImports, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports' import { VideoPrivacy } from '../../../../shared/models/videos' -import { waitJobs } from '../../../../shared/utils/server/jobs' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' import { expect } from 'chai' import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' diff --git a/server/tests/api/check-params/video-abuses.ts b/server/tests/api/check-params/video-abuses.ts index 7edc8e39d..78e4acf2f 100644 --- a/server/tests/api/check-params/video-abuses.ts +++ b/server/tests/api/check-params/video-abuses.ts @@ -15,12 +15,12 @@ import { updateVideoAbuse, uploadVideo, userLogin -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' +} from '../../../../shared/extra-utils/requests/check-api-params' import { VideoAbuseState } from '../../../../shared/models/videos' describe('Test video abuses API validators', function () { diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.ts index 81423aee9..c2e9622cc 100644 --- a/server/tests/api/check-params/video-blacklist.ts +++ b/server/tests/api/check-params/video-blacklist.ts @@ -18,12 +18,12 @@ import { setAccessTokensToServers, uploadVideo, userLogin, waitJobs -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' +} from '../../../../shared/extra-utils/requests/check-api-params' import { VideoDetails, VideoBlacklistType } from '../../../../shared/models/videos' import { expect } from 'chai' diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.ts index de2ca8cd1..4ef5e03ed 100644 --- a/server/tests/api/check-params/video-captions.ts +++ b/server/tests/api/check-params/video-captions.ts @@ -13,9 +13,9 @@ import { setAccessTokensToServers, uploadVideo, userLogin -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { join } from 'path' -import { createVideoCaption } from '../../../../shared/utils/videos/video-captions' +import { createVideoCaption } from '../../../../shared/extra-utils/videos/video-captions' describe('Test video captions API validator', function () { const path = '/api/v1/videos/' diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts index b72fc4220..b6aa745ab 100644 --- a/server/tests/api/check-params/video-channels.ts +++ b/server/tests/api/check-params/video-channels.ts @@ -20,12 +20,12 @@ import { ServerInfo, setAccessTokensToServers, userLogin -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' +} from '../../../../shared/extra-utils/requests/check-api-params' import { User } from '../../../../shared/models/users' import { join } from 'path' diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts index 5f70998ef..b80d91279 100644 --- a/server/tests/api/check-params/video-comments.ts +++ b/server/tests/api/check-params/video-comments.ts @@ -6,13 +6,13 @@ import { createUser, flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, uploadVideo, userLogin -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' -import { addVideoCommentThread } from '../../../../shared/utils/videos/video-comments' +} from '../../../../shared/extra-utils/requests/check-api-params' +import { addVideoCommentThread } from '../../../../shared/extra-utils/videos/video-comments' const expect = chai.expect diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts index 4d2bf2e8d..ad4c4def0 100644 --- a/server/tests/api/check-params/video-imports.ts +++ b/server/tests/api/check-params/video-imports.ts @@ -18,13 +18,13 @@ import { setAccessTokensToServers, updateCustomSubConfig, userLogin -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' -import { getMagnetURI, getYoutubeVideoUrl } from '../../../../shared/utils/videos/video-imports' +} from '../../../../shared/extra-utils/requests/check-api-params' +import { getMagnetURI, getYoutubeVideoUrl } from '../../../../shared/extra-utils/videos/video-imports' describe('Test video imports API validator', function () { const path = '/api/v1/videos/imports' diff --git a/server/tests/api/check-params/video-playlists.ts b/server/tests/api/check-params/video-playlists.ts index 229c23118..0f3484763 100644 --- a/server/tests/api/check-params/video-playlists.ts +++ b/server/tests/api/check-params/video-playlists.ts @@ -20,12 +20,12 @@ import { updateVideoPlaylist, updateVideoPlaylistElement, uploadVideoAndGetId -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' +} from '../../../../shared/extra-utils/requests/check-api-params' import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model' diff --git a/server/tests/api/check-params/videos-filter.ts b/server/tests/api/check-params/videos-filter.ts index 7c487ae81..971867b27 100644 --- a/server/tests/api/check-params/videos-filter.ts +++ b/server/tests/api/check-params/videos-filter.ts @@ -11,7 +11,7 @@ import { ServerInfo, setAccessTokensToServers, setDefaultVideoChannel, userLogin -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { UserRole } from '../../../../shared/models/users' import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' diff --git a/server/tests/api/check-params/videos-history.ts b/server/tests/api/check-params/videos-history.ts index 8c079a956..11e277644 100644 --- a/server/tests/api/check-params/videos-history.ts +++ b/server/tests/api/check-params/videos-history.ts @@ -14,7 +14,7 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' const expect = chai.expect diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index 3f0e0d646..e96f324cc 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts @@ -9,13 +9,13 @@ import { createUser, flushTests, getMyUserInformation, getVideo, getVideosList, immutableAssign, killallServers, makeDeleteRequest, makeGetRequest, makeUploadRequest, makePutBodyRequest, removeVideo, uploadVideo, runServer, ServerInfo, setAccessTokensToServers, userLogin, updateCustomSubConfig -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination -} from '../../../../shared/utils/requests/check-api-params' -import { getAccountsList } from '../../../../shared/utils/users/accounts' +} from '../../../../shared/extra-utils/requests/check-api-params' +import { getAccountsList } from '../../../../shared/extra-utils/users/accounts' const expect = chai.expect diff --git a/server/tests/api/notifications/user-notifications.ts b/server/tests/api/notifications/user-notifications.ts index d1d6f3c35..8f7ce82a4 100644 --- a/server/tests/api/notifications/user-notifications.ts +++ b/server/tests/api/notifications/user-notifications.ts @@ -20,11 +20,11 @@ import { wait, getCustomConfig, updateCustomConfig, getVideoThreadComments, getVideoCommentThreads, follow -} from '../../../../shared/utils' -import { killallServers, ServerInfo, uploadVideo } from '../../../../shared/utils/index' -import { setAccessTokensToServers } from '../../../../shared/utils/users/login' -import { waitJobs } from '../../../../shared/utils/server/jobs' -import { getUserNotificationSocket } from '../../../../shared/utils/socket/socket-io' +} from '../../../../shared/extra-utils' +import { killallServers, ServerInfo, uploadVideo } from '../../../../shared/extra-utils/index' +import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' +import { getUserNotificationSocket } from '../../../../shared/extra-utils/socket/socket-io' import { checkCommentMention, CheckerBaseParams, @@ -42,7 +42,7 @@ import { markAsReadNotifications, updateMyNotificationSettings, markAsReadAllNotifications, checkNewInstanceFollower -} from '../../../../shared/utils/users/user-notifications' +} from '../../../../shared/extra-utils/users/user-notifications' import { User, UserNotification, @@ -50,13 +50,13 @@ import { UserNotificationSettingValue, UserNotificationType } from '../../../../shared/models/users' -import { MockSmtpServer } from '../../../../shared/utils/miscs/email' -import { addUserSubscription, removeUserSubscription } from '../../../../shared/utils/users/user-subscriptions' +import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' +import { addUserSubscription, removeUserSubscription } from '../../../../shared/extra-utils/users/user-subscriptions' import { VideoPrivacy } from '../../../../shared/models/videos' -import { getBadVideoUrl, getYoutubeVideoUrl, importVideo } from '../../../../shared/utils/videos/video-imports' -import { addVideoCommentReply, addVideoCommentThread } from '../../../../shared/utils/videos/video-comments' +import { getBadVideoUrl, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports' +import { addVideoCommentReply, addVideoCommentThread } from '../../../../shared/extra-utils/videos/video-comments' import * as uuidv4 from 'uuid/v4' -import { addAccountToAccountBlocklist, removeAccountFromAccountBlocklist } from '../../../../shared/utils/users/blocklist' +import { addAccountToAccountBlocklist, removeAccountFromAccountBlocklist } from '../../../../shared/extra-utils/users/blocklist' import { CustomConfig } from '../../../../shared/models/server' import { VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts index 33921763d..280a4c64b 100644 --- a/server/tests/api/redundancy/redundancy.ts +++ b/server/tests/api/redundancy/redundancy.ts @@ -24,16 +24,16 @@ import { viewVideo, wait, waitUntilLog -} from '../../../../shared/utils' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' import * as magnetUtil from 'magnet-uri' -import { updateRedundancy } from '../../../../shared/utils/server/redundancy' +import { updateRedundancy } from '../../../../shared/extra-utils/server/redundancy' import { ActorFollow } from '../../../../shared/models/actors' import { readdir } from 'fs-extra' import { join } from 'path' import { VideoRedundancyStrategy } from '../../../../shared/models/redundancy' -import { getStats } from '../../../../shared/utils/server/stats' +import { getStats } from '../../../../shared/extra-utils/server/stats' import { ServerStats } from '../../../../shared/models/server/server-stats.model' const expect = chai.expect diff --git a/server/tests/api/search/search-activitypub-video-channels.ts b/server/tests/api/search/search-activitypub-video-channels.ts index 682bd262a..1f59a951b 100644 --- a/server/tests/api/search/search-activitypub-video-channels.ts +++ b/server/tests/api/search/search-activitypub-video-channels.ts @@ -17,10 +17,10 @@ import { uploadVideo, userLogin, wait -} from '../../../../shared/utils' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' import { VideoChannel } from '../../../../shared/models/videos' -import { searchVideoChannel } from '../../../../shared/utils/search/video-channels' +import { searchVideoChannel } from '../../../../shared/extra-utils/search/video-channels' const expect = chai.expect diff --git a/server/tests/api/search/search-activitypub-videos.ts b/server/tests/api/search/search-activitypub-videos.ts index f881917e7..d984c696c 100644 --- a/server/tests/api/search/search-activitypub-videos.ts +++ b/server/tests/api/search/search-activitypub-videos.ts @@ -16,8 +16,8 @@ import { uploadVideo, wait, searchVideo -} from '../../../../shared/utils' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' import { Video, VideoPrivacy } from '../../../../shared/models/videos' const expect = chai.expect diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts index fa4078b99..65f3c9186 100644 --- a/server/tests/api/search/search-videos.ts +++ b/server/tests/api/search/search-videos.ts @@ -13,7 +13,7 @@ import { uploadVideo, wait, immutableAssign -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' const expect = chai.expect diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index 5373d02f2..a99916627 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts @@ -16,7 +16,7 @@ import { runServer, setAccessTokensToServers, updateCustomConfig -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { ServerConfig } from '../../../../shared/models' const expect = chai.expect diff --git a/server/tests/api/server/contact-form.ts b/server/tests/api/server/contact-form.ts index 06a2f89b0..fdd5e9730 100644 --- a/server/tests/api/server/contact-form.ts +++ b/server/tests/api/server/contact-form.ts @@ -2,10 +2,10 @@ import * as chai from 'chai' import 'mocha' -import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, wait } from '../../../../shared/utils' -import { MockSmtpServer } from '../../../../shared/utils/miscs/email' -import { waitJobs } from '../../../../shared/utils/server/jobs' -import { sendContactForm } from '../../../../shared/utils/server/contact-form' +import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, wait } from '../../../../shared/extra-utils' +import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' +import { sendContactForm } from '../../../../shared/extra-utils/server/contact-form' const expect = chai.expect diff --git a/server/tests/api/server/email.ts b/server/tests/api/server/email.ts index bc45102d2..a40a281f8 100644 --- a/server/tests/api/server/email.ts +++ b/server/tests/api/server/email.ts @@ -19,9 +19,9 @@ import { killallServers, ServerInfo, setAccessTokensToServers -} from '../../../../shared/utils' -import { MockSmtpServer } from '../../../../shared/utils/miscs/email' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils' +import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' const expect = chai.expect diff --git a/server/tests/api/server/follow-constraints.ts b/server/tests/api/server/follow-constraints.ts index 28862a1c6..bdd8b1c70 100644 --- a/server/tests/api/server/follow-constraints.ts +++ b/server/tests/api/server/follow-constraints.ts @@ -13,10 +13,10 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo -} from '../../../../shared/utils' -import { unfollow } from '../../../../shared/utils/server/follows' -import { userLogin } from '../../../../shared/utils/users/login' -import { createUser } from '../../../../shared/utils/users/users' +} from '../../../../shared/extra-utils' +import { unfollow } from '../../../../shared/extra-utils/server/follows' +import { userLogin } from '../../../../shared/extra-utils/users/login' +import { createUser } from '../../../../shared/extra-utils/users/users' const expect = chai.expect diff --git a/server/tests/api/server/follows-moderation.ts b/server/tests/api/server/follows-moderation.ts index 0bb3aa866..f4a826ea8 100644 --- a/server/tests/api/server/follows-moderation.ts +++ b/server/tests/api/server/follows-moderation.ts @@ -9,15 +9,15 @@ import { ServerInfo, setAccessTokensToServers, updateCustomSubConfig -} from '../../../../shared/utils/index' +} from '../../../../shared/extra-utils/index' import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, removeFollower, rejectFollower -} from '../../../../shared/utils/server/follows' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils/server/follows' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' import { ActorFollow } from '../../../../shared/models/actors' const expect = chai.expect diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.ts index a5e6c3c1e..527b54e1e 100644 --- a/server/tests/api/server/follows.ts +++ b/server/tests/api/server/follows.ts @@ -4,7 +4,7 @@ import * as chai from 'chai' import 'mocha' import { Video, VideoPrivacy } from '../../../../shared/models/videos' import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' -import { completeVideoCheck } from '../../../../shared/utils' +import { completeVideoCheck } from '../../../../shared/extra-utils' import { flushAndRunMultipleServers, getVideosList, @@ -12,26 +12,26 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo -} from '../../../../shared/utils/index' -import { dateIsValid } from '../../../../shared/utils/miscs/miscs' +} from '../../../../shared/extra-utils/index' +import { dateIsValid } from '../../../../shared/extra-utils/miscs/miscs' import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow -} from '../../../../shared/utils/server/follows' -import { expectAccountFollows } from '../../../../shared/utils/users/accounts' -import { userLogin } from '../../../../shared/utils/users/login' -import { createUser } from '../../../../shared/utils/users/users' +} from '../../../../shared/extra-utils/server/follows' +import { expectAccountFollows } from '../../../../shared/extra-utils/users/accounts' +import { userLogin } from '../../../../shared/extra-utils/users/login' +import { createUser } from '../../../../shared/extra-utils/users/users' import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments -} from '../../../../shared/utils/videos/video-comments' -import { rateVideo } from '../../../../shared/utils/videos/videos' -import { waitJobs } from '../../../../shared/utils/server/jobs' -import { createVideoCaption, listVideoCaptions, testCaptionFile } from '../../../../shared/utils/videos/video-captions' +} from '../../../../shared/extra-utils/videos/video-comments' +import { rateVideo } from '../../../../shared/extra-utils/videos/videos' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' +import { createVideoCaption, listVideoCaptions, testCaptionFile } from '../../../../shared/extra-utils/videos/video-captions' import { VideoCaption } from '../../../../shared/models/videos/caption/video-caption.model' const expect = chai.expect diff --git a/server/tests/api/server/handle-down.ts b/server/tests/api/server/handle-down.ts index cd5acbe16..8c49541ee 100644 --- a/server/tests/api/server/handle-down.ts +++ b/server/tests/api/server/handle-down.ts @@ -20,15 +20,15 @@ import { updateVideo, uploadVideo, wait -} from '../../../../shared/utils' -import { follow, getFollowersListPaginationAndSort } from '../../../../shared/utils/server/follows' -import { getJobsListPaginationAndSort, waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils' +import { follow, getFollowersListPaginationAndSort } from '../../../../shared/extra-utils/server/follows' +import { getJobsListPaginationAndSort, waitJobs } from '../../../../shared/extra-utils/server/jobs' import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments -} from '../../../../shared/utils/videos/video-comments' +} from '../../../../shared/extra-utils/videos/video-comments' const expect = chai.expect diff --git a/server/tests/api/server/jobs.ts b/server/tests/api/server/jobs.ts index 52948b1d6..1d7429873 100644 --- a/server/tests/api/server/jobs.ts +++ b/server/tests/api/server/jobs.ts @@ -2,12 +2,12 @@ import * as chai from 'chai' import 'mocha' -import { killallServers, ServerInfo, setAccessTokensToServers } from '../../../../shared/utils/index' -import { doubleFollow } from '../../../../shared/utils/server/follows' -import { getJobsList, getJobsListPaginationAndSort, waitJobs } from '../../../../shared/utils/server/jobs' -import { flushAndRunMultipleServers } from '../../../../shared/utils/server/servers' -import { uploadVideo } from '../../../../shared/utils/videos/videos' -import { dateIsValid } from '../../../../shared/utils/miscs/miscs' +import { killallServers, ServerInfo, setAccessTokensToServers } from '../../../../shared/extra-utils/index' +import { doubleFollow } from '../../../../shared/extra-utils/server/follows' +import { getJobsList, getJobsListPaginationAndSort, waitJobs } from '../../../../shared/extra-utils/server/jobs' +import { flushAndRunMultipleServers } from '../../../../shared/extra-utils/server/servers' +import { uploadVideo } from '../../../../shared/extra-utils/videos/videos' +import { dateIsValid } from '../../../../shared/extra-utils/miscs/miscs' const expect = chai.expect diff --git a/server/tests/api/server/logs.ts b/server/tests/api/server/logs.ts index 05b0308de..f55e12407 100644 --- a/server/tests/api/server/logs.ts +++ b/server/tests/api/server/logs.ts @@ -2,10 +2,10 @@ import * as chai from 'chai' import 'mocha' -import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers } from '../../../../shared/utils/index' -import { waitJobs } from '../../../../shared/utils/server/jobs' -import { uploadVideo } from '../../../../shared/utils/videos/videos' -import { getLogs } from '../../../../shared/utils/logs/logs' +import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers } from '../../../../shared/extra-utils/index' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' +import { uploadVideo } from '../../../../shared/extra-utils/videos/videos' +import { getLogs } from '../../../../shared/extra-utils/logs/logs' const expect = chai.expect diff --git a/server/tests/api/server/no-client.ts b/server/tests/api/server/no-client.ts index 3b95ce945..88d34063c 100644 --- a/server/tests/api/server/no-client.ts +++ b/server/tests/api/server/no-client.ts @@ -4,8 +4,8 @@ import { flushTests, killallServers, ServerInfo -} from '../../../../shared/utils' -import { runServer } from '../../../../shared/utils/server/servers' +} from '../../../../shared/extra-utils' +import { runServer } from '../../../../shared/extra-utils/server/servers' describe('Start and stop server without web client routes', function () { let server: ServerInfo diff --git a/server/tests/api/server/reverse-proxy.ts b/server/tests/api/server/reverse-proxy.ts index ee0fffd5a..e7dc16531 100644 --- a/server/tests/api/server/reverse-proxy.ts +++ b/server/tests/api/server/reverse-proxy.ts @@ -15,7 +15,7 @@ import { userLogin, viewVideo, wait -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' const expect = chai.expect import { @@ -23,7 +23,7 @@ import { flushTests, runServer, registerUser, getCustomConfig, setAccessTokensToServers, updateCustomConfig -} from '../../../../shared/utils/index' +} from '../../../../shared/extra-utils/index' describe('Test application behind a reverse proxy', function () { let server = null diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts index eadbcaf83..48addad22 100644 --- a/server/tests/api/server/stats.ts +++ b/server/tests/api/server/stats.ts @@ -13,11 +13,11 @@ import { uploadVideo, viewVideo, wait -} from '../../../../shared/utils' -import { flushTests, setAccessTokensToServers } from '../../../../shared/utils/index' -import { getStats } from '../../../../shared/utils/server/stats' -import { addVideoCommentThread } from '../../../../shared/utils/videos/video-comments' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils' +import { flushTests, setAccessTokensToServers } from '../../../../shared/extra-utils/index' +import { getStats } from '../../../../shared/extra-utils/server/stats' +import { addVideoCommentThread } from '../../../../shared/extra-utils/videos/video-comments' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' const expect = chai.expect diff --git a/server/tests/api/server/tracker.ts b/server/tests/api/server/tracker.ts index 41803aef1..4f7cc05a7 100644 --- a/server/tests/api/server/tracker.ts +++ b/server/tests/api/server/tracker.ts @@ -2,8 +2,8 @@ import * as magnetUtil from 'magnet-uri' import 'mocha' -import { getVideo, killallServers, reRunServer, runServer, ServerInfo, uploadVideo } from '../../../../shared/utils' -import { flushTests, setAccessTokensToServers } from '../../../../shared/utils/index' +import { getVideo, killallServers, reRunServer, runServer, ServerInfo, uploadVideo } from '../../../../shared/extra-utils' +import { flushTests, setAccessTokensToServers } from '../../../../shared/extra-utils/index' import { VideoDetails } from '../../../../shared/models/videos' import * as WebTorrent from 'webtorrent' diff --git a/server/tests/api/users/blocklist.ts b/server/tests/api/users/blocklist.ts index 638a443ba..cd96ffe2a 100644 --- a/server/tests/api/users/blocklist.ts +++ b/server/tests/api/users/blocklist.ts @@ -12,16 +12,16 @@ import { ServerInfo, uploadVideo, userLogin -} from '../../../../shared/utils/index' -import { setAccessTokensToServers } from '../../../../shared/utils/users/login' -import { getVideosListWithToken, getVideosList } from '../../../../shared/utils/videos/videos' +} from '../../../../shared/extra-utils/index' +import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' +import { getVideosListWithToken, getVideosList } from '../../../../shared/extra-utils/videos/videos' import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments -} from '../../../../shared/utils/videos/video-comments' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils/videos/video-comments' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' import { addAccountToAccountBlocklist, @@ -36,7 +36,7 @@ import { removeAccountFromServerBlocklist, removeServerFromAccountBlocklist, removeServerFromServerBlocklist -} from '../../../../shared/utils/users/blocklist' +} from '../../../../shared/extra-utils/users/blocklist' const expect = chai.expect diff --git a/server/tests/api/users/user-subscriptions.ts b/server/tests/api/users/user-subscriptions.ts index 037a79a76..5be185678 100644 --- a/server/tests/api/users/user-subscriptions.ts +++ b/server/tests/api/users/user-subscriptions.ts @@ -11,18 +11,18 @@ import { unfollow, updateVideo, userLogin -} from '../../../../shared/utils' -import { killallServers, ServerInfo, uploadVideo } from '../../../../shared/utils/index' -import { setAccessTokensToServers } from '../../../../shared/utils/users/login' +} from '../../../../shared/extra-utils' +import { killallServers, ServerInfo, uploadVideo } from '../../../../shared/extra-utils/index' +import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' import { Video, VideoChannel } from '../../../../shared/models/videos' -import { waitJobs } from '../../../../shared/utils/server/jobs' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' import { addUserSubscription, listUserSubscriptions, listUserSubscriptionVideos, removeUserSubscription, getUserSubscription, areSubscriptionsExist -} from '../../../../shared/utils/users/user-subscriptions' +} from '../../../../shared/extra-utils/users/user-subscriptions' const expect = chai.expect diff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.ts index 0510b2de9..9b8db0072 100644 --- a/server/tests/api/users/users-multiple-servers.ts +++ b/server/tests/api/users/users-multiple-servers.ts @@ -14,13 +14,20 @@ import { removeUser, updateMyUser, userLogin -} from '../../../../shared/utils' -import { getMyUserInformation, killallServers, ServerInfo, testImage, updateMyAvatar, uploadVideo } from '../../../../shared/utils/index' -import { checkActorFilesWereRemoved, getAccount, getAccountsList } from '../../../../shared/utils/users/accounts' -import { setAccessTokensToServers } from '../../../../shared/utils/users/login' +} from '../../../../shared/extra-utils' +import { + getMyUserInformation, + killallServers, + ServerInfo, + testImage, + updateMyAvatar, + uploadVideo +} from '../../../../shared/extra-utils/index' +import { checkActorFilesWereRemoved, getAccount, getAccountsList } from '../../../../shared/extra-utils/users/accounts' +import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' import { User } from '../../../../shared/models/users' import { VideoChannel } from '../../../../shared/models/videos' -import { waitJobs } from '../../../../shared/utils/server/jobs' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' const expect = chai.expect diff --git a/server/tests/api/users/users-verification.ts b/server/tests/api/users/users-verification.ts index babeda2b8..7fcd3e50b 100644 --- a/server/tests/api/users/users-verification.ts +++ b/server/tests/api/users/users-verification.ts @@ -5,10 +5,10 @@ import 'mocha' import { registerUser, flushTests, getUserInformation, getMyUserInformation, killallServers, userLogin, login, runServer, ServerInfo, verifyEmail, updateCustomSubConfig, wait -} from '../../../../shared/utils' -import { setAccessTokensToServers } from '../../../../shared/utils/users/login' -import { MockSmtpServer } from '../../../../shared/utils/miscs/email' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils' +import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' +import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' const expect = chai.expect diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 13511e070..472ff511c 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts @@ -33,10 +33,10 @@ import { updateUser, uploadVideo, userLogin -} from '../../../../shared/utils' -import { follow } from '../../../../shared/utils/server/follows' -import { setAccessTokensToServers } from '../../../../shared/utils/users/login' -import { getMyVideos } from '../../../../shared/utils/videos/videos' +} from '../../../../shared/extra-utils' +import { follow } from '../../../../shared/extra-utils/server/follows' +import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' +import { getMyVideos } from '../../../../shared/extra-utils/videos/videos' import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' const expect = chai.expect diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index 46486b777..dd50f905d 100644 --- a/server/tests/api/videos/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts @@ -32,15 +32,15 @@ import { viewVideo, wait, webtorrentAdd -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { addVideoCommentReply, addVideoCommentThread, deleteVideoComment, getVideoCommentThreads, getVideoThreadComments -} from '../../../../shared/utils/videos/video-comments' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils/videos/video-comments' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' const expect = chai.expect diff --git a/server/tests/api/videos/services.ts b/server/tests/api/videos/services.ts index 2da86964f..e79ce59a6 100644 --- a/server/tests/api/videos/services.ts +++ b/server/tests/api/videos/services.ts @@ -10,8 +10,8 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo -} from '../../../../shared/utils/index' -import { runServer } from '../../../../shared/utils/server/servers' +} from '../../../../shared/extra-utils/index' +import { runServer } from '../../../../shared/extra-utils/server/servers' const expect = chai.expect diff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.ts index cfdcbaf3f..ea3e7c421 100644 --- a/server/tests/api/videos/single-server.ts +++ b/server/tests/api/videos/single-server.ts @@ -28,7 +28,7 @@ import { uploadVideo, viewVideo, wait -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' const expect = chai.expect diff --git a/server/tests/api/videos/video-abuse.ts b/server/tests/api/videos/video-abuse.ts index 3a7b623da..2ae1bf34d 100644 --- a/server/tests/api/videos/video-abuse.ts +++ b/server/tests/api/videos/video-abuse.ts @@ -14,9 +14,9 @@ import { setAccessTokensToServers, updateVideoAbuse, uploadVideo -} from '../../../../shared/utils/index' -import { doubleFollow } from '../../../../shared/utils/server/follows' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils/index' +import { doubleFollow } from '../../../../shared/extra-utils/server/follows' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' const expect = chai.expect diff --git a/server/tests/api/videos/video-blacklist.ts b/server/tests/api/videos/video-blacklist.ts index 1feae19e9..582c82e05 100644 --- a/server/tests/api/videos/video-blacklist.ts +++ b/server/tests/api/videos/video-blacklist.ts @@ -20,9 +20,9 @@ import { updateVideoBlacklist, uploadVideo, userLogin -} from '../../../../shared/utils/index' -import { doubleFollow } from '../../../../shared/utils/server/follows' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils/index' +import { doubleFollow } from '../../../../shared/extra-utils/server/follows' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' import { VideoBlacklist, VideoBlacklistType } from '../../../../shared/models/videos' import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' import { UserRole } from '../../../../shared/models/users' diff --git a/server/tests/api/videos/video-captions.ts b/server/tests/api/videos/video-captions.ts index 57bee713f..da920e00c 100644 --- a/server/tests/api/videos/video-captions.ts +++ b/server/tests/api/videos/video-captions.ts @@ -9,10 +9,15 @@ import { removeVideo, uploadVideo, wait -} from '../../../../shared/utils' -import { flushTests, killallServers, ServerInfo, setAccessTokensToServers } from '../../../../shared/utils/index' -import { waitJobs } from '../../../../shared/utils/server/jobs' -import { createVideoCaption, deleteVideoCaption, listVideoCaptions, testCaptionFile } from '../../../../shared/utils/videos/video-captions' +} from '../../../../shared/extra-utils' +import { flushTests, killallServers, ServerInfo, setAccessTokensToServers } from '../../../../shared/extra-utils/index' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' +import { + createVideoCaption, + deleteVideoCaption, + listVideoCaptions, + testCaptionFile +} from '../../../../shared/extra-utils/videos/video-captions' import { VideoCaption } from '../../../../shared/models/videos/caption/video-caption.model' const expect = chai.expect diff --git a/server/tests/api/videos/video-change-ownership.ts b/server/tests/api/videos/video-change-ownership.ts index a23e30dc0..9040ac308 100644 --- a/server/tests/api/videos/video-change-ownership.ts +++ b/server/tests/api/videos/video-change-ownership.ts @@ -18,8 +18,8 @@ import { uploadVideo, userLogin, getVideo -} from '../../../../shared/utils' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' import { User } from '../../../../shared/models/users' import { VideoDetails } from '../../../../shared/models/videos' diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts index bd672cf41..e30e6bb4f 100644 --- a/server/tests/api/videos/video-channels.ts +++ b/server/tests/api/videos/video-channels.ts @@ -13,7 +13,7 @@ import { updateVideoChannelAvatar, uploadVideo, userLogin -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { addVideoChannel, deleteVideoChannel, @@ -26,8 +26,8 @@ import { ServerInfo, setAccessTokensToServers, updateVideoChannel -} from '../../../../shared/utils/index' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils/index' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' const expect = chai.expect diff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.ts index ce1b17e35..abf4d0c44 100644 --- a/server/tests/api/videos/video-comments.ts +++ b/server/tests/api/videos/video-comments.ts @@ -3,7 +3,7 @@ import * as chai from 'chai' import 'mocha' import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' -import { testImage } from '../../../../shared/utils' +import { testImage } from '../../../../shared/extra-utils' import { dateIsValid, flushTests, @@ -13,14 +13,14 @@ import { setAccessTokensToServers, updateMyAvatar, uploadVideo -} from '../../../../shared/utils/index' +} from '../../../../shared/extra-utils/index' import { addVideoCommentReply, addVideoCommentThread, deleteVideoComment, getVideoCommentThreads, getVideoThreadComments -} from '../../../../shared/utils/videos/video-comments' +} from '../../../../shared/extra-utils/videos/video-comments' const expect = chai.expect diff --git a/server/tests/api/videos/video-description.ts b/server/tests/api/videos/video-description.ts index cbda0b9a6..0c03d17d8 100644 --- a/server/tests/api/videos/video-description.ts +++ b/server/tests/api/videos/video-description.ts @@ -12,9 +12,9 @@ import { setAccessTokensToServers, updateVideo, uploadVideo -} from '../../../../shared/utils/index' -import { doubleFollow } from '../../../../shared/utils/server/follows' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils/index' +import { doubleFollow } from '../../../../shared/extra-utils/server/follows' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' const expect = chai.expect diff --git a/server/tests/api/videos/video-hls.ts b/server/tests/api/videos/video-hls.ts index 3d04758b1..a9251406a 100644 --- a/server/tests/api/videos/video-hls.ts +++ b/server/tests/api/videos/video-hls.ts @@ -18,7 +18,7 @@ import { updateVideo, uploadVideo, waitJobs -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { VideoDetails } from '../../../../shared/models/videos' import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type' import { join } from 'path' diff --git a/server/tests/api/videos/video-imports.ts b/server/tests/api/videos/video-imports.ts index c5ffb793b..f8b2c0407 100644 --- a/server/tests/api/videos/video-imports.ts +++ b/server/tests/api/videos/video-imports.ts @@ -14,9 +14,9 @@ import { killallServers, ServerInfo, setAccessTokensToServers -} from '../../../../shared/utils' -import { waitJobs } from '../../../../shared/utils/server/jobs' -import { getMagnetURI, getYoutubeVideoUrl, importVideo, getMyVideoImports } from '../../../../shared/utils/videos/video-imports' +} from '../../../../shared/extra-utils' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' +import { getMagnetURI, getYoutubeVideoUrl, importVideo, getMyVideoImports } from '../../../../shared/extra-utils/videos/video-imports' const expect = chai.expect diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.ts index cb972d921..9f2d99ffe 100644 --- a/server/tests/api/videos/video-nsfw.ts +++ b/server/tests/api/videos/video-nsfw.ts @@ -9,10 +9,10 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo -} from '../../../../shared/utils/index' -import { userLogin } from '../../../../shared/utils/users/login' -import { createUser } from '../../../../shared/utils/users/users' -import { getMyVideos } from '../../../../shared/utils/videos/videos' +} from '../../../../shared/extra-utils/index' +import { userLogin } from '../../../../shared/extra-utils/users/login' +import { createUser } from '../../../../shared/extra-utils/users/users' +import { getMyVideos } from '../../../../shared/extra-utils/videos/videos' import { getAccountVideos, getConfig, @@ -25,7 +25,7 @@ import { searchVideoWithToken, updateCustomConfig, updateMyUser -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { ServerConfig } from '../../../../shared/models' import { CustomConfig } from '../../../../shared/models/server/custom-config.model' import { User } from '../../../../shared/models/users' diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts index d9cb71992..8c3542906 100644 --- a/server/tests/api/videos/video-playlists.ts +++ b/server/tests/api/videos/video-playlists.ts @@ -36,7 +36,7 @@ import { uploadVideoAndGetId, userLogin, waitJobs -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' import { VideoPlaylist } from '../../../../shared/models/videos/playlist/video-playlist.model' import { Video } from '../../../../shared/models/videos' diff --git a/server/tests/api/videos/video-privacy.ts b/server/tests/api/videos/video-privacy.ts index e1b5fb193..ba5e0f044 100644 --- a/server/tests/api/videos/video-privacy.ts +++ b/server/tests/api/videos/video-privacy.ts @@ -10,12 +10,12 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo -} from '../../../../shared/utils/index' -import { doubleFollow } from '../../../../shared/utils/server/follows' -import { userLogin } from '../../../../shared/utils/users/login' -import { createUser } from '../../../../shared/utils/users/users' -import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../../../shared/utils/videos/videos' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils/index' +import { doubleFollow } from '../../../../shared/extra-utils/server/follows' +import { userLogin } from '../../../../shared/extra-utils/users/login' +import { createUser } from '../../../../shared/extra-utils/users/users' +import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../../../shared/extra-utils/videos/videos' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' const expect = chai.expect diff --git a/server/tests/api/videos/video-schedule-update.ts b/server/tests/api/videos/video-schedule-update.ts index 632c4244c..b19a9116a 100644 --- a/server/tests/api/videos/video-schedule-update.ts +++ b/server/tests/api/videos/video-schedule-update.ts @@ -15,8 +15,8 @@ import { updateVideo, uploadVideo, wait -} from '../../../../shared/utils' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' const expect = chai.expect diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts index eefd32ef8..3d4739ca9 100644 --- a/server/tests/api/videos/video-transcoder.ts +++ b/server/tests/api/videos/video-transcoder.ts @@ -19,9 +19,9 @@ import { setAccessTokensToServers, uploadVideo, webtorrentAdd -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { extname, join } from 'path' -import { waitJobs } from '../../../../shared/utils/server/jobs' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants' const expect = chai.expect diff --git a/server/tests/api/videos/videos-filter.ts b/server/tests/api/videos/videos-filter.ts index 920ca0023..36664b17f 100644 --- a/server/tests/api/videos/videos-filter.ts +++ b/server/tests/api/videos/videos-filter.ts @@ -13,7 +13,7 @@ import { setAccessTokensToServers, uploadVideo, userLogin -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { Video, VideoPrivacy } from '../../../../shared/models/videos' import { UserRole } from '../../../../shared/models/users' diff --git a/server/tests/api/videos/videos-history.ts b/server/tests/api/videos/videos-history.ts index ab40bb64c..6f75ce42c 100644 --- a/server/tests/api/videos/videos-history.ts +++ b/server/tests/api/videos/videos-history.ts @@ -16,9 +16,9 @@ import { uploadVideo, userLogin, wait -} from '../../../../shared/utils' +} from '../../../../shared/extra-utils' import { Video, VideoDetails } from '../../../../shared/models/videos' -import { listMyVideosHistory, removeMyVideosHistory, userWatchVideo } from '../../../../shared/utils/videos/video-history' +import { listMyVideosHistory, removeMyVideosHistory, userWatchVideo } from '../../../../shared/extra-utils/videos/video-history' const expect = chai.expect diff --git a/server/tests/api/videos/videos-overview.ts b/server/tests/api/videos/videos-overview.ts index 7221bcae6..233ca8a5d 100644 --- a/server/tests/api/videos/videos-overview.ts +++ b/server/tests/api/videos/videos-overview.ts @@ -2,8 +2,8 @@ import * as chai from 'chai' import 'mocha' -import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../../../shared/utils' -import { getVideosOverview } from '../../../../shared/utils/overviews/overviews' +import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../../../shared/extra-utils' +import { getVideosOverview } from '../../../../shared/extra-utils/overviews/overviews' import { VideosOverview } from '../../../../shared/models/overviews' const expect = chai.expect diff --git a/server/tests/api/videos/videos-views-cleaner.ts b/server/tests/api/videos/videos-views-cleaner.ts index 9f268c8e6..4001969c3 100644 --- a/server/tests/api/videos/videos-views-cleaner.ts +++ b/server/tests/api/videos/videos-views-cleaner.ts @@ -11,10 +11,10 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo, uploadVideoAndGetId, viewVideo, wait, countVideoViewsOf, doubleFollow, waitJobs -} from '../../../../shared/utils' -import { getVideosOverview } from '../../../../shared/utils/overviews/overviews' +} from '../../../../shared/extra-utils' +import { getVideosOverview } from '../../../../shared/extra-utils/overviews/overviews' import { VideosOverview } from '../../../../shared/models/overviews' -import { listMyVideosHistory } from '../../../../shared/utils/videos/video-history' +import { listMyVideosHistory } from '../../../../shared/extra-utils/videos/video-history' const expect = chai.expect diff --git a/server/tests/cli/create-import-video-file-job.ts b/server/tests/cli/create-import-video-file-job.ts index 4acda47b1..4dc12a1c6 100644 --- a/server/tests/cli/create-import-video-file-job.ts +++ b/server/tests/cli/create-import-video-file-job.ts @@ -15,8 +15,8 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo -} from '../../../shared/utils' -import { waitJobs } from '../../../shared/utils/server/jobs' +} from '../../../shared/extra-utils' +import { waitJobs } from '../../../shared/extra-utils/server/jobs' const expect = chai.expect diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.ts index 50be5fa19..bd1de2079 100644 --- a/server/tests/cli/create-transcoding-job.ts +++ b/server/tests/cli/create-transcoding-job.ts @@ -15,8 +15,8 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo, wait -} from '../../../shared/utils' -import { waitJobs } from '../../../shared/utils/server/jobs' +} from '../../../shared/extra-utils' +import { waitJobs } from '../../../shared/extra-utils/server/jobs' const expect = chai.expect diff --git a/server/tests/cli/optimize-old-videos.ts b/server/tests/cli/optimize-old-videos.ts index f84ba1ece..b3724476b 100644 --- a/server/tests/cli/optimize-old-videos.ts +++ b/server/tests/cli/optimize-old-videos.ts @@ -15,8 +15,8 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo, viewVideo, wait -} from '../../../shared/utils' -import { waitJobs } from '../../../shared/utils/server/jobs' +} from '../../../shared/extra-utils' +import { waitJobs } from '../../../shared/extra-utils/server/jobs' import { getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../../helpers/ffmpeg-utils' import { VIDEO_TRANSCODING_FPS } from '../../initializers/constants' import { join } from 'path' diff --git a/server/tests/cli/peertube.ts b/server/tests/cli/peertube.ts index b0ae876d3..45411bdbc 100644 --- a/server/tests/cli/peertube.ts +++ b/server/tests/cli/peertube.ts @@ -11,7 +11,7 @@ import { runServer, ServerInfo, setAccessTokensToServers -} from '../../../shared/utils' +} from '../../../shared/extra-utils' describe('Test CLI wrapper', function () { let server: ServerInfo diff --git a/server/tests/cli/reset-password.ts b/server/tests/cli/reset-password.ts index 4c9f0c5f8..3c56bf45b 100644 --- a/server/tests/cli/reset-password.ts +++ b/server/tests/cli/reset-password.ts @@ -10,7 +10,7 @@ import { runServer, ServerInfo, setAccessTokensToServers -} from '../../../shared/utils' +} from '../../../shared/extra-utils' describe('Test reset password scripts', function () { let server: ServerInfo diff --git a/server/tests/cli/update-host.ts b/server/tests/cli/update-host.ts index 39533edea..2270ff494 100644 --- a/server/tests/cli/update-host.ts +++ b/server/tests/cli/update-host.ts @@ -3,8 +3,8 @@ import 'mocha' import * as chai from 'chai' import { VideoDetails } from '../../../shared/models/videos' -import { waitJobs } from '../../../shared/utils/server/jobs' -import { addVideoCommentThread } from '../../../shared/utils/videos/video-comments' +import { waitJobs } from '../../../shared/extra-utils/server/jobs' +import { addVideoCommentThread } from '../../../shared/extra-utils/videos/video-comments' import { addVideoChannel, createUser, @@ -21,8 +21,8 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo -} from '../../../shared/utils' -import { getAccountsList } from '../../../shared/utils/users/accounts' +} from '../../../shared/extra-utils' +import { getAccountsList } from '../../../shared/extra-utils/users/accounts' const expect = chai.expect diff --git a/server/tests/client.ts b/server/tests/client.ts index 06b4a9c5a..116189510 100644 --- a/server/tests/client.ts +++ b/server/tests/client.ts @@ -15,7 +15,7 @@ import { updateCustomConfig, updateCustomSubConfig, uploadVideo -} from '../../shared/utils' +} from '../../shared/extra-utils' const expect = chai.expect diff --git a/server/tests/feeds/feeds.ts b/server/tests/feeds/feeds.ts index d632be427..0e9ea1a18 100644 --- a/server/tests/feeds/feeds.ts +++ b/server/tests/feeds/feeds.ts @@ -13,10 +13,10 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo, userLogin -} from '../../../shared/utils' +} from '../../../shared/extra-utils' import * as libxmljs from 'libxmljs' -import { addVideoCommentThread } from '../../../shared/utils/videos/video-comments' -import { waitJobs } from '../../../shared/utils/server/jobs' +import { addVideoCommentThread } from '../../../shared/extra-utils/videos/video-comments' +import { waitJobs } from '../../../shared/extra-utils/server/jobs' import { User } from '../../../shared/models/users' chai.use(require('chai-xml')) diff --git a/server/tests/helpers/request.ts b/server/tests/helpers/request.ts index 95a74fdfa..a754bc6e2 100644 --- a/server/tests/helpers/request.ts +++ b/server/tests/helpers/request.ts @@ -2,7 +2,7 @@ import 'mocha' import { doRequest, doRequestAndSaveToFile } from '../../helpers/requests' -import { get4KFileUrl, root, wait } from '../../../shared/utils' +import { get4KFileUrl, root, wait } from '../../../shared/extra-utils' import { join } from 'path' import { pathExists, remove } from 'fs-extra' import { expect } from 'chai' diff --git a/server/tests/misc-endpoints.ts b/server/tests/misc-endpoints.ts index 104876f2f..d78b62d60 100644 --- a/server/tests/misc-endpoints.ts +++ b/server/tests/misc-endpoints.ts @@ -12,7 +12,7 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo -} from '../../shared/utils' +} from '../../shared/extra-utils' import { VideoPrivacy } from '../../shared/models/videos' const expect = chai.expect diff --git a/server/tests/real-world/populate-database.ts b/server/tests/real-world/populate-database.ts index 3616127ad..459c9cbd8 100644 --- a/server/tests/real-world/populate-database.ts +++ b/server/tests/real-world/populate-database.ts @@ -10,7 +10,7 @@ import { ServerInfo, setAccessTokensToServers, uploadVideo -} from '../../../shared/utils' +} from '../../../shared/extra-utils' import * as Bluebird from 'bluebird' start() diff --git a/server/tests/real-world/real-world.ts b/server/tests/real-world/real-world.ts index ac3baaf9a..8b070004d 100644 --- a/server/tests/real-world/real-world.ts +++ b/server/tests/real-world/real-world.ts @@ -16,8 +16,8 @@ import { updateVideo, uploadVideo, viewVideo, wait -} from '../../../shared/utils' -import { getJobsListPaginationAndSort } from '../../../shared/utils/server/jobs' +} from '../../../shared/extra-utils' +import { getJobsListPaginationAndSort } from '../../../shared/extra-utils/server/jobs' interface ServerInfo extends DefaultServerInfo { requestsNumber: number diff --git a/server/tools/peertube-get-access-token.ts b/server/tools/peertube-get-access-token.ts index a68665f5b..85660de2c 100644 --- a/server/tools/peertube-get-access-token.ts +++ b/server/tools/peertube-get-access-token.ts @@ -6,7 +6,7 @@ import { Server, Client, User -} from '../../shared/utils' +} from '../../shared/extra-utils' program .option('-u, --url ', 'Server url') diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts index 03f13b5e2..8c4c711f7 100644 --- a/server/tools/peertube-import-videos.ts +++ b/server/tools/peertube-import-videos.ts @@ -6,7 +6,7 @@ import { join } from 'path' import { VideoPrivacy } from '../../shared/models/videos' import { doRequestAndSaveToFile } from '../helpers/requests' import { CONSTRAINTS_FIELDS } from '../initializers/constants' -import { getClient, getVideoCategories, login, searchVideoWithSort, uploadVideo } from '../../shared/utils/index' +import { getClient, getVideoCategories, login, searchVideoWithSort, uploadVideo } from '../../shared/extra-utils/index' import { truncate } from 'lodash' import * as prompt from 'prompt' import { remove } from 'fs-extra' diff --git a/server/tools/peertube-upload.ts b/server/tools/peertube-upload.ts index ebc62c965..13ca94e51 100644 --- a/server/tools/peertube-upload.ts +++ b/server/tools/peertube-upload.ts @@ -1,8 +1,8 @@ import * as program from 'commander' import { access, constants } from 'fs-extra' import { isAbsolute } from 'path' -import { getClient, login } from '../../shared/utils' -import { uploadVideo } from '../../shared/utils/' +import { getClient, login } from '../../shared/extra-utils' +import { uploadVideo } from '../../shared/extra-utils/' import { VideoPrivacy } from '../../shared/models/videos' import { netrc, getSettings } from './cli' -- cgit v1.2.3