diff options
author | Chocobozzz <me@florianbigard.com> | 2018-12-07 16:09:57 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-12-07 16:25:29 +0100 |
commit | 2a8c5d0af13f3ccb9a505e1fbc9d324b9d33ba1f (patch) | |
tree | 998a0af6923475c85eb8e97ca1d30afb42655263 /server/tests/api/videos | |
parent | 4b49385892b25aea5aa9e605fbcb66074bcb49b0 (diff) | |
parent | 35adc403b7eed6d1309bbce901268a76dd01b6ef (diff) | |
download | PeerTube-2a8c5d0af13f3ccb9a505e1fbc9d324b9d33ba1f.tar.gz PeerTube-2a8c5d0af13f3ccb9a505e1fbc9d324b9d33ba1f.tar.zst PeerTube-2a8c5d0af13f3ccb9a505e1fbc9d324b9d33ba1f.zip |
Merge branch 'move-utils-to-shared' of https://github.com/buoyantair/PeerTube into buoyantair-move-utils-to-shared
Diffstat (limited to 'server/tests/api/videos')
19 files changed, 76 insertions, 53 deletions
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index b9ace2885..aa38b6b33 100644 --- a/server/tests/api/videos/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts | |||
@@ -31,15 +31,15 @@ import { | |||
31 | viewVideo, | 31 | viewVideo, |
32 | wait, | 32 | wait, |
33 | webtorrentAdd | 33 | webtorrentAdd |
34 | } from '../../utils' | 34 | } from '../../../../shared/utils' |
35 | import { | 35 | import { |
36 | addVideoCommentReply, | 36 | addVideoCommentReply, |
37 | addVideoCommentThread, | 37 | addVideoCommentThread, |
38 | deleteVideoComment, | 38 | deleteVideoComment, |
39 | getVideoCommentThreads, | 39 | getVideoCommentThreads, |
40 | getVideoThreadComments | 40 | getVideoThreadComments |
41 | } from '../../utils/videos/video-comments' | 41 | } from '../../../../shared/utils/videos/video-comments' |
42 | import { waitJobs } from '../../utils/server/jobs' | 42 | import { waitJobs } from '../../../../shared/utils/server/jobs' |
43 | 43 | ||
44 | const expect = chai.expect | 44 | const expect = chai.expect |
45 | 45 | ||
diff --git a/server/tests/api/videos/services.ts b/server/tests/api/videos/services.ts index 2f1424292..2da86964f 100644 --- a/server/tests/api/videos/services.ts +++ b/server/tests/api/videos/services.ts | |||
@@ -2,8 +2,16 @@ | |||
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { flushTests, getOEmbed, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index' | 5 | import { |
6 | import { runServer } from '../../utils/server/servers' | 6 | flushTests, |
7 | getOEmbed, | ||
8 | getVideosList, | ||
9 | killallServers, | ||
10 | ServerInfo, | ||
11 | setAccessTokensToServers, | ||
12 | uploadVideo | ||
13 | } from '../../../../shared/utils/index' | ||
14 | import { runServer } from '../../../../shared/utils/server/servers' | ||
7 | 15 | ||
8 | const expect = chai.expect | 16 | const expect = chai.expect |
9 | 17 | ||
diff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.ts index 089c3df25..069dec67c 100644 --- a/server/tests/api/videos/single-server.ts +++ b/server/tests/api/videos/single-server.ts | |||
@@ -28,7 +28,7 @@ import { | |||
28 | uploadVideo, | 28 | uploadVideo, |
29 | viewVideo, | 29 | viewVideo, |
30 | wait | 30 | wait |
31 | } from '../../utils' | 31 | } from '../../../../shared/utils' |
32 | 32 | ||
33 | const expect = chai.expect | 33 | const expect = chai.expect |
34 | 34 | ||
diff --git a/server/tests/api/videos/video-abuse.ts b/server/tests/api/videos/video-abuse.ts index a17f3c8de..3a7b623da 100644 --- a/server/tests/api/videos/video-abuse.ts +++ b/server/tests/api/videos/video-abuse.ts | |||
@@ -14,9 +14,9 @@ import { | |||
14 | setAccessTokensToServers, | 14 | setAccessTokensToServers, |
15 | updateVideoAbuse, | 15 | updateVideoAbuse, |
16 | uploadVideo | 16 | uploadVideo |
17 | } from '../../utils/index' | 17 | } from '../../../../shared/utils/index' |
18 | import { doubleFollow } from '../../utils/server/follows' | 18 | import { doubleFollow } from '../../../../shared/utils/server/follows' |
19 | import { waitJobs } from '../../utils/server/jobs' | 19 | import { waitJobs } from '../../../../shared/utils/server/jobs' |
20 | 20 | ||
21 | const expect = chai.expect | 21 | const expect = chai.expect |
22 | 22 | ||
diff --git a/server/tests/api/videos/video-blacklist-management.ts b/server/tests/api/videos/video-blacklist-management.ts index fab577b30..61411e30d 100644 --- a/server/tests/api/videos/video-blacklist-management.ts +++ b/server/tests/api/videos/video-blacklist-management.ts | |||
@@ -16,9 +16,9 @@ import { | |||
16 | setAccessTokensToServers, | 16 | setAccessTokensToServers, |
17 | updateVideoBlacklist, | 17 | updateVideoBlacklist, |
18 | uploadVideo | 18 | uploadVideo |
19 | } from '../../utils/index' | 19 | } from '../../../../shared/utils/index' |
20 | import { doubleFollow } from '../../utils/server/follows' | 20 | import { doubleFollow } from '../../../../shared/utils/server/follows' |
21 | import { waitJobs } from '../../utils/server/jobs' | 21 | import { waitJobs } from '../../../../shared/utils/server/jobs' |
22 | import { VideoAbuse } from '../../../../shared/models/videos' | 22 | import { VideoAbuse } from '../../../../shared/models/videos' |
23 | 23 | ||
24 | const expect = chai.expect | 24 | const expect = chai.expect |
diff --git a/server/tests/api/videos/video-blacklist.ts b/server/tests/api/videos/video-blacklist.ts index de4c68f1d..1cce82d2a 100644 --- a/server/tests/api/videos/video-blacklist.ts +++ b/server/tests/api/videos/video-blacklist.ts | |||
@@ -11,9 +11,9 @@ import { | |||
11 | ServerInfo, | 11 | ServerInfo, |
12 | setAccessTokensToServers, | 12 | setAccessTokensToServers, |
13 | uploadVideo | 13 | uploadVideo |
14 | } from '../../utils/index' | 14 | } from '../../../../shared/utils/index' |
15 | import { doubleFollow } from '../../utils/server/follows' | 15 | import { doubleFollow } from '../../../../shared/utils/server/follows' |
16 | import { waitJobs } from '../../utils/server/jobs' | 16 | import { waitJobs } from '../../../../shared/utils/server/jobs' |
17 | 17 | ||
18 | const expect = chai.expect | 18 | const expect = chai.expect |
19 | 19 | ||
diff --git a/server/tests/api/videos/video-captions.ts b/server/tests/api/videos/video-captions.ts index 6e441410d..57bee713f 100644 --- a/server/tests/api/videos/video-captions.ts +++ b/server/tests/api/videos/video-captions.ts | |||
@@ -2,10 +2,17 @@ | |||
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { checkVideoFilesWereRemoved, doubleFollow, flushAndRunMultipleServers, removeVideo, uploadVideo, wait } from '../../utils' | 5 | import { |
6 | import { flushTests, killallServers, ServerInfo, setAccessTokensToServers } from '../../utils/index' | 6 | checkVideoFilesWereRemoved, |
7 | import { waitJobs } from '../../utils/server/jobs' | 7 | doubleFollow, |
8 | import { createVideoCaption, deleteVideoCaption, listVideoCaptions, testCaptionFile } from '../../utils/videos/video-captions' | 8 | flushAndRunMultipleServers, |
9 | removeVideo, | ||
10 | uploadVideo, | ||
11 | wait | ||
12 | } from '../../../../shared/utils' | ||
13 | import { flushTests, killallServers, ServerInfo, setAccessTokensToServers } from '../../../../shared/utils/index' | ||
14 | import { waitJobs } from '../../../../shared/utils/server/jobs' | ||
15 | import { createVideoCaption, deleteVideoCaption, listVideoCaptions, testCaptionFile } from '../../../../shared/utils/videos/video-captions' | ||
9 | import { VideoCaption } from '../../../../shared/models/videos/caption/video-caption.model' | 16 | import { VideoCaption } from '../../../../shared/models/videos/caption/video-caption.model' |
10 | 17 | ||
11 | const expect = chai.expect | 18 | 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 1578a471d..25675a966 100644 --- a/server/tests/api/videos/video-change-ownership.ts +++ b/server/tests/api/videos/video-change-ownership.ts | |||
@@ -18,8 +18,8 @@ import { | |||
18 | uploadVideo, | 18 | uploadVideo, |
19 | userLogin, | 19 | userLogin, |
20 | getVideo | 20 | getVideo |
21 | } from '../../utils' | 21 | } from '../../../../shared/utils' |
22 | import { waitJobs } from '../../utils/server/jobs' | 22 | import { waitJobs } from '../../../../shared/utils/server/jobs' |
23 | import { User } from '../../../../shared/models/users' | 23 | import { User } from '../../../../shared/models/users' |
24 | import { VideoDetails } from '../../../../shared/models/videos' | 24 | import { VideoDetails } from '../../../../shared/models/videos' |
25 | 25 | ||
diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts index 41429a3d8..63514d69c 100644 --- a/server/tests/api/videos/video-channels.ts +++ b/server/tests/api/videos/video-channels.ts | |||
@@ -13,7 +13,7 @@ import { | |||
13 | updateVideoChannelAvatar, | 13 | updateVideoChannelAvatar, |
14 | uploadVideo, | 14 | uploadVideo, |
15 | userLogin | 15 | userLogin |
16 | } from '../../utils' | 16 | } from '../../../../shared/utils' |
17 | import { | 17 | import { |
18 | addVideoChannel, | 18 | addVideoChannel, |
19 | deleteVideoChannel, | 19 | deleteVideoChannel, |
@@ -26,8 +26,8 @@ import { | |||
26 | ServerInfo, | 26 | ServerInfo, |
27 | setAccessTokensToServers, | 27 | setAccessTokensToServers, |
28 | updateVideoChannel | 28 | updateVideoChannel |
29 | } from '../../utils/index' | 29 | } from '../../../../shared/utils/index' |
30 | import { waitJobs } from '../../utils/server/jobs' | 30 | import { waitJobs } from '../../../../shared/utils/server/jobs' |
31 | 31 | ||
32 | const expect = chai.expect | 32 | const expect = chai.expect |
33 | 33 | ||
diff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.ts index d6e07c5b3..ce1b17e35 100644 --- a/server/tests/api/videos/video-comments.ts +++ b/server/tests/api/videos/video-comments.ts | |||
@@ -3,7 +3,7 @@ | |||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' | 5 | import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' |
6 | import { testImage } from '../../utils' | 6 | import { testImage } from '../../../../shared/utils' |
7 | import { | 7 | import { |
8 | dateIsValid, | 8 | dateIsValid, |
9 | flushTests, | 9 | flushTests, |
@@ -13,14 +13,14 @@ import { | |||
13 | setAccessTokensToServers, | 13 | setAccessTokensToServers, |
14 | updateMyAvatar, | 14 | updateMyAvatar, |
15 | uploadVideo | 15 | uploadVideo |
16 | } from '../../utils/index' | 16 | } from '../../../../shared/utils/index' |
17 | import { | 17 | import { |
18 | addVideoCommentReply, | 18 | addVideoCommentReply, |
19 | addVideoCommentThread, | 19 | addVideoCommentThread, |
20 | deleteVideoComment, | 20 | deleteVideoComment, |
21 | getVideoCommentThreads, | 21 | getVideoCommentThreads, |
22 | getVideoThreadComments | 22 | getVideoThreadComments |
23 | } from '../../utils/videos/video-comments' | 23 | } from '../../../../shared/utils/videos/video-comments' |
24 | 24 | ||
25 | const expect = chai.expect | 25 | const expect = chai.expect |
26 | 26 | ||
diff --git a/server/tests/api/videos/video-description.ts b/server/tests/api/videos/video-description.ts index dd5cd78c0..cbda0b9a6 100644 --- a/server/tests/api/videos/video-description.ts +++ b/server/tests/api/videos/video-description.ts | |||
@@ -12,9 +12,9 @@ import { | |||
12 | setAccessTokensToServers, | 12 | setAccessTokensToServers, |
13 | updateVideo, | 13 | updateVideo, |
14 | uploadVideo | 14 | uploadVideo |
15 | } from '../../utils/index' | 15 | } from '../../../../shared/utils/index' |
16 | import { doubleFollow } from '../../utils/server/follows' | 16 | import { doubleFollow } from '../../../../shared/utils/server/follows' |
17 | import { waitJobs } from '../../utils/server/jobs' | 17 | import { waitJobs } from '../../../../shared/utils/server/jobs' |
18 | 18 | ||
19 | const expect = chai.expect | 19 | const expect = chai.expect |
20 | 20 | ||
diff --git a/server/tests/api/videos/video-imports.ts b/server/tests/api/videos/video-imports.ts index aaee79a4a..cd4988553 100644 --- a/server/tests/api/videos/video-imports.ts +++ b/server/tests/api/videos/video-imports.ts | |||
@@ -14,9 +14,9 @@ import { | |||
14 | killallServers, | 14 | killallServers, |
15 | ServerInfo, | 15 | ServerInfo, |
16 | setAccessTokensToServers | 16 | setAccessTokensToServers |
17 | } from '../../utils' | 17 | } from '../../../../shared/utils' |
18 | import { waitJobs } from '../../utils/server/jobs' | 18 | import { waitJobs } from '../../../../shared/utils/server/jobs' |
19 | import { getMagnetURI, getYoutubeVideoUrl, importVideo, getMyVideoImports } from '../../utils/videos/video-imports' | 19 | import { getMagnetURI, getYoutubeVideoUrl, importVideo, getMyVideoImports } from '../../../../shared/utils/videos/video-imports' |
20 | 20 | ||
21 | const expect = chai.expect | 21 | const expect = chai.expect |
22 | 22 | ||
diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.ts index eab7a6991..df1ee2eb9 100644 --- a/server/tests/api/videos/video-nsfw.ts +++ b/server/tests/api/videos/video-nsfw.ts | |||
@@ -2,10 +2,17 @@ | |||
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index' | 5 | import { |
6 | import { userLogin } from '../../utils/users/login' | 6 | flushTests, |
7 | import { createUser } from '../../utils/users/users' | 7 | getVideosList, |
8 | import { getMyVideos } from '../../utils/videos/videos' | 8 | killallServers, |
9 | ServerInfo, | ||
10 | setAccessTokensToServers, | ||
11 | uploadVideo | ||
12 | } from '../../../../shared/utils/index' | ||
13 | import { userLogin } from '../../../../shared/utils/users/login' | ||
14 | import { createUser } from '../../../../shared/utils/users/users' | ||
15 | import { getMyVideos } from '../../../../shared/utils/videos/videos' | ||
9 | import { | 16 | import { |
10 | getAccountVideos, | 17 | getAccountVideos, |
11 | getConfig, | 18 | getConfig, |
@@ -18,7 +25,7 @@ import { | |||
18 | searchVideoWithToken, | 25 | searchVideoWithToken, |
19 | updateCustomConfig, | 26 | updateCustomConfig, |
20 | updateMyUser | 27 | updateMyUser |
21 | } from '../../utils' | 28 | } from '../../../../shared/utils' |
22 | import { ServerConfig } from '../../../../shared/models' | 29 | import { ServerConfig } from '../../../../shared/models' |
23 | import { CustomConfig } from '../../../../shared/models/server/custom-config.model' | 30 | import { CustomConfig } from '../../../../shared/models/server/custom-config.model' |
24 | import { User } from '../../../../shared/models/users' | 31 | import { User } from '../../../../shared/models/users' |
diff --git a/server/tests/api/videos/video-privacy.ts b/server/tests/api/videos/video-privacy.ts index 9fefca7e3..0b4e66369 100644 --- a/server/tests/api/videos/video-privacy.ts +++ b/server/tests/api/videos/video-privacy.ts | |||
@@ -10,12 +10,12 @@ import { | |||
10 | ServerInfo, | 10 | ServerInfo, |
11 | setAccessTokensToServers, | 11 | setAccessTokensToServers, |
12 | uploadVideo | 12 | uploadVideo |
13 | } from '../../utils/index' | 13 | } from '../../../../shared/utils/index' |
14 | import { doubleFollow } from '../../utils/server/follows' | 14 | import { doubleFollow } from '../../../../shared/utils/server/follows' |
15 | import { userLogin } from '../../utils/users/login' | 15 | import { userLogin } from '../../../../shared/utils/users/login' |
16 | import { createUser } from '../../utils/users/users' | 16 | import { createUser } from '../../../../shared/utils/users/users' |
17 | import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../utils/videos/videos' | 17 | import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../../../shared/utils/videos/videos' |
18 | import { waitJobs } from '../../utils/server/jobs' | 18 | import { waitJobs } from '../../../../shared/utils/server/jobs' |
19 | 19 | ||
20 | const expect = chai.expect | 20 | const expect = chai.expect |
21 | 21 | ||
diff --git a/server/tests/api/videos/video-schedule-update.ts b/server/tests/api/videos/video-schedule-update.ts index b226a9d50..632c4244c 100644 --- a/server/tests/api/videos/video-schedule-update.ts +++ b/server/tests/api/videos/video-schedule-update.ts | |||
@@ -15,8 +15,8 @@ import { | |||
15 | updateVideo, | 15 | updateVideo, |
16 | uploadVideo, | 16 | uploadVideo, |
17 | wait | 17 | wait |
18 | } from '../../utils' | 18 | } from '../../../../shared/utils' |
19 | import { waitJobs } from '../../utils/server/jobs' | 19 | import { waitJobs } from '../../../../shared/utils/server/jobs' |
20 | 20 | ||
21 | const expect = chai.expect | 21 | const expect = chai.expect |
22 | 22 | ||
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts index 23920d452..68cf00194 100644 --- a/server/tests/api/videos/video-transcoder.ts +++ b/server/tests/api/videos/video-transcoder.ts | |||
@@ -19,9 +19,10 @@ import { | |||
19 | setAccessTokensToServers, | 19 | setAccessTokensToServers, |
20 | uploadVideo, | 20 | uploadVideo, |
21 | webtorrentAdd | 21 | webtorrentAdd |
22 | } from '../../utils' | 22 | } from '../../../../shared/utils' |
23 | import { join } from 'path' | 23 | import { join } from 'path' |
24 | import { waitJobs } from '../../utils/server/jobs' | 24 | import { waitJobs } from '../../../../shared/utils/server/jobs' |
25 | import { pathExists } from 'fs-extra' | ||
25 | import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants' | 26 | import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants' |
26 | 27 | ||
27 | const expect = chai.expect | 28 | const expect = chai.expect |
diff --git a/server/tests/api/videos/videos-filter.ts b/server/tests/api/videos/videos-filter.ts index a7588129f..59e37ad86 100644 --- a/server/tests/api/videos/videos-filter.ts +++ b/server/tests/api/videos/videos-filter.ts | |||
@@ -13,7 +13,7 @@ import { | |||
13 | setAccessTokensToServers, | 13 | setAccessTokensToServers, |
14 | uploadVideo, | 14 | uploadVideo, |
15 | userLogin | 15 | userLogin |
16 | } from '../../utils' | 16 | } from '../../../../shared/utils' |
17 | import { Video, VideoPrivacy } from '../../../../shared/models/videos' | 17 | import { Video, VideoPrivacy } from '../../../../shared/models/videos' |
18 | import { UserRole } from '../../../../shared/models/users' | 18 | import { UserRole } from '../../../../shared/models/users' |
19 | 19 | ||
diff --git a/server/tests/api/videos/videos-history.ts b/server/tests/api/videos/videos-history.ts index 6d289b288..40ae94f79 100644 --- a/server/tests/api/videos/videos-history.ts +++ b/server/tests/api/videos/videos-history.ts | |||
@@ -11,9 +11,9 @@ import { | |||
11 | ServerInfo, | 11 | ServerInfo, |
12 | setAccessTokensToServers, | 12 | setAccessTokensToServers, |
13 | uploadVideo | 13 | uploadVideo |
14 | } from '../../utils' | 14 | } from '../../../../shared/utils' |
15 | import { Video, VideoDetails } from '../../../../shared/models/videos' | 15 | import { Video, VideoDetails } from '../../../../shared/models/videos' |
16 | import { userWatchVideo } from '../../utils/videos/video-history' | 16 | import { userWatchVideo } from '../../../../shared/utils/videos/video-history' |
17 | 17 | ||
18 | const expect = chai.expect | 18 | const expect = chai.expect |
19 | 19 | ||
diff --git a/server/tests/api/videos/videos-overview.ts b/server/tests/api/videos/videos-overview.ts index 7d1f29c92..7221bcae6 100644 --- a/server/tests/api/videos/videos-overview.ts +++ b/server/tests/api/videos/videos-overview.ts | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils' | 5 | import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../../../shared/utils' |
6 | import { getVideosOverview } from '../../utils/overviews/overviews' | 6 | import { getVideosOverview } from '../../../../shared/utils/overviews/overviews' |
7 | import { VideosOverview } from '../../../../shared/models/overviews' | 7 | import { VideosOverview } from '../../../../shared/models/overviews' |
8 | 8 | ||
9 | const expect = chai.expect | 9 | const expect = chai.expect |