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/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 +++--- 21 files changed, 60 insertions(+), 55 deletions(-) (limited to 'server/tests/api/videos') 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 -- cgit v1.2.3