diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-28 13:59:22 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-28 13:59:22 +0100 |
commit | c5d31dba56d669c0df0209761c43c5a6ac7cec4a (patch) | |
tree | fe72b56a1c0e7beb6e092c393a00ddfe93a5d71f /server/tests/api | |
parent | db799da3d2b2ea465165df78ff71effa653b6309 (diff) | |
download | PeerTube-c5d31dba56d669c0df0209761c43c5a6ac7cec4a.tar.gz PeerTube-c5d31dba56d669c0df0209761c43c5a6ac7cec4a.tar.zst PeerTube-c5d31dba56d669c0df0209761c43c5a6ac7cec4a.zip |
Tests directories refractor
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/check-params/services.ts | 2 | ||||
-rw-r--r-- | server/tests/api/check-params/video-comments.ts | 2 | ||||
-rw-r--r-- | server/tests/api/index-fast.ts | 18 | ||||
-rw-r--r-- | server/tests/api/index-slow.ts | 10 | ||||
-rw-r--r-- | server/tests/api/server/config.ts (renamed from server/tests/api/config.ts) | 2 | ||||
-rw-r--r-- | server/tests/api/server/follows.ts (renamed from server/tests/api/follows.ts) | 19 | ||||
-rw-r--r-- | server/tests/api/server/jobs.ts (renamed from server/tests/api/jobs.ts) | 12 | ||||
-rw-r--r-- | server/tests/api/users/users.ts (renamed from server/tests/api/users.ts) | 10 | ||||
-rw-r--r-- | server/tests/api/videos/multiple-servers.ts (renamed from server/tests/api/multiple-servers.ts) | 13 | ||||
-rw-r--r-- | server/tests/api/videos/services.ts (renamed from server/tests/api/services.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/single-server.ts (renamed from server/tests/api/single-server.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-abuse.ts (renamed from server/tests/api/video-abuse.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-blacklist-management.ts (renamed from server/tests/api/video-blacklist-management.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-blacklist.ts (renamed from server/tests/api/video-blacklist.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-channels.ts (renamed from server/tests/api/video-channels.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-comments.ts (renamed from server/tests/api/video-comments.ts) | 9 | ||||
-rw-r--r-- | server/tests/api/videos/video-description.ts (renamed from server/tests/api/video-description.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-privacy.ts (renamed from server/tests/api/video-privacy.ts) | 12 | ||||
-rw-r--r-- | server/tests/api/videos/video-transcoder.ts (renamed from server/tests/api/video-transcoder.ts) | 2 |
19 files changed, 74 insertions, 65 deletions
diff --git a/server/tests/api/check-params/services.ts b/server/tests/api/check-params/services.ts index 780254df5..f82520574 100644 --- a/server/tests/api/check-params/services.ts +++ b/server/tests/api/check-params/services.ts | |||
@@ -9,7 +9,7 @@ import { | |||
9 | setAccessTokensToServers, | 9 | setAccessTokensToServers, |
10 | killallServers | 10 | killallServers |
11 | } from '../../utils' | 11 | } from '../../utils' |
12 | import { getVideosList, uploadVideo } from '../../utils/videos' | 12 | import { getVideosList, uploadVideo } from '../../utils/videos/videos' |
13 | 13 | ||
14 | describe('Test services API validators', function () { | 14 | describe('Test services API validators', function () { |
15 | let server | 15 | let server |
diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts index e8d7ddf38..f3832bd2c 100644 --- a/server/tests/api/check-params/video-comments.ts +++ b/server/tests/api/check-params/video-comments.ts | |||
@@ -3,7 +3,7 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as request from 'supertest' | 4 | import * as request from 'supertest' |
5 | import { flushTests, killallServers, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils' | 5 | import { flushTests, killallServers, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils' |
6 | import { addVideoCommentThread } from '../../utils/video-comments' | 6 | import { addVideoCommentThread } from '../../utils/videos/video-comments' |
7 | 7 | ||
8 | describe('Test video comments API validator', function () { | 8 | describe('Test video comments API validator', function () { |
9 | let pathThread: string | 9 | let pathThread: string |
diff --git a/server/tests/api/index-fast.ts b/server/tests/api/index-fast.ts index 35b414383..e591d0fd2 100644 --- a/server/tests/api/index-fast.ts +++ b/server/tests/api/index-fast.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | // Order of the tests we want to execute | 1 | // Order of the tests we want to execute |
2 | import './config' | 2 | import './server/config' |
3 | import './check-params' | 3 | import './check-params' |
4 | import './users' | 4 | import './users/users' |
5 | import './single-server' | 5 | import './videos/single-server' |
6 | import './video-abuse' | 6 | import './videos/video-abuse' |
7 | import './video-blacklist' | 7 | import './videos/video-blacklist' |
8 | import './video-blacklist-management' | 8 | import './videos/video-blacklist-management' |
9 | import './video-description' | 9 | import './videos/video-description' |
10 | import './video-privacy' | 10 | import './videos/video-privacy' |
11 | import './services' | 11 | import './videos/services' |
diff --git a/server/tests/api/index-slow.ts b/server/tests/api/index-slow.ts index b525d6f01..23b6526c7 100644 --- a/server/tests/api/index-slow.ts +++ b/server/tests/api/index-slow.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | // Order of the tests we want to execute | 1 | // Order of the tests we want to execute |
2 | // import './multiple-servers' | 2 | // import './multiple-servers' |
3 | import './video-transcoder' | 3 | import './videos/video-transcoder' |
4 | import './multiple-servers' | 4 | import './videos/multiple-servers' |
5 | import './follows' | 5 | import './server/follows' |
6 | import './jobs' | 6 | import './server/jobs' |
7 | import './video-comments' | 7 | import './videos/video-comments' |
diff --git a/server/tests/api/config.ts b/server/tests/api/server/config.ts index 61ae57977..e8846c8db 100644 --- a/server/tests/api/config.ts +++ b/server/tests/api/server/config.ts | |||
@@ -9,7 +9,7 @@ import { | |||
9 | flushTests, | 9 | flushTests, |
10 | runServer, | 10 | runServer, |
11 | registerUser | 11 | registerUser |
12 | } from '../utils' | 12 | } from '../../utils/index' |
13 | 13 | ||
14 | describe('Test config', function () { | 14 | describe('Test config', function () { |
15 | let server = null | 15 | let server = null |
diff --git a/server/tests/api/follows.ts b/server/tests/api/server/follows.ts index 2ffa426a0..f77c0c67c 100644 --- a/server/tests/api/follows.ts +++ b/server/tests/api/server/follows.ts | |||
@@ -2,18 +2,21 @@ | |||
2 | 2 | ||
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 | 6 | ||
7 | import { | 7 | import { |
8 | flushAndRunMultipleServers, flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo, | 8 | flushAndRunMultipleServers, flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo, |
9 | wait | 9 | wait |
10 | } from '../utils' | 10 | } from '../../utils/index' |
11 | import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../utils/follows' | 11 | import { dateIsValid, webtorrentAdd } from '../../utils/miscs/miscs' |
12 | import { getUserAccessToken } from '../utils/login' | 12 | import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../../utils/server/follows' |
13 | import { dateIsValid, webtorrentAdd } from '../utils/miscs' | 13 | import { getUserAccessToken } from '../../utils/users/login' |
14 | import { createUser } from '../utils/users' | 14 | import { createUser } from '../../utils/users/users' |
15 | import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments' | 15 | import { |
16 | import { getVideo, rateVideo, testVideoImage } from '../utils/videos' | 16 | addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, |
17 | getVideoThreadComments | ||
18 | } from '../../utils/videos/video-comments' | ||
19 | import { getVideo, rateVideo, testVideoImage } from '../../utils/videos/videos' | ||
17 | 20 | ||
18 | const expect = chai.expect | 21 | const expect = chai.expect |
19 | 22 | ||
diff --git a/server/tests/api/jobs.ts b/server/tests/api/server/jobs.ts index 4d9b61392..2e17e71a4 100644 --- a/server/tests/api/jobs.ts +++ b/server/tests/api/server/jobs.ts | |||
@@ -2,12 +2,12 @@ | |||
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { flushTests, killallServers, ServerInfo, setAccessTokensToServers, wait } from '../utils' | 5 | import { flushTests, killallServers, ServerInfo, setAccessTokensToServers, wait } from '../../utils/index' |
6 | import { doubleFollow } from '../utils/follows' | 6 | import { doubleFollow } from '../../utils/server/follows' |
7 | import { getJobsList, getJobsListPaginationAndSort } from '../utils/jobs' | 7 | import { getJobsList, getJobsListPaginationAndSort } from '../../utils/server/jobs' |
8 | import { flushAndRunMultipleServers } from '../utils/servers' | 8 | import { flushAndRunMultipleServers } from '../../utils/server/servers' |
9 | import { uploadVideo } from '../utils/videos' | 9 | import { uploadVideo } from '../../utils/videos/videos' |
10 | import { dateIsValid } from '../utils/miscs' | 10 | import { dateIsValid } from '../../utils/miscs/miscs' |
11 | 11 | ||
12 | const expect = chai.expect | 12 | const expect = chai.expect |
13 | 13 | ||
diff --git a/server/tests/api/users.ts b/server/tests/api/users/users.ts index 67e4cc8c6..2e3a0b94f 100644 --- a/server/tests/api/users.ts +++ b/server/tests/api/users/users.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { UserRole } from '../../../shared' | 5 | import { UserRole } from '../../../../shared/index' |
6 | import { | 6 | import { |
7 | createUser, | 7 | createUser, |
8 | flushTests, | 8 | flushTests, |
@@ -26,10 +26,10 @@ import { | |||
26 | updateMyUser, | 26 | updateMyUser, |
27 | updateUser, | 27 | updateUser, |
28 | uploadVideo | 28 | uploadVideo |
29 | } from '../utils' | 29 | } from '../../utils/index' |
30 | import { follow } from '../utils/follows' | 30 | import { follow } from '../../utils/server/follows' |
31 | import { getMyVideos } from '../utils/videos' | 31 | import { getMyVideos } from '../../utils/videos/videos' |
32 | import { setAccessTokensToServers } from '../utils/login' | 32 | import { setAccessTokensToServers } from '../../utils/users/login' |
33 | 33 | ||
34 | const expect = chai.expect | 34 | const expect = chai.expect |
35 | 35 | ||
diff --git a/server/tests/api/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index 06274d4cc..84f730a8e 100644 --- a/server/tests/api/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts | |||
@@ -4,16 +4,19 @@ import * as chai from 'chai' | |||
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import * as request from 'supertest' | 6 | import * as request from 'supertest' |
7 | import { VideoComment, VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model' | 7 | import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' |
8 | 8 | ||
9 | import { | 9 | import { |
10 | addVideoChannel, dateIsValid, doubleFollow, flushAndRunMultipleServers, flushTests, getUserAccessToken, getVideo, | 10 | addVideoChannel, dateIsValid, doubleFollow, flushAndRunMultipleServers, flushTests, getUserAccessToken, getVideo, |
11 | getVideoChannelsList, getVideosList, killallServers, rateVideo, removeVideo, ServerInfo, setAccessTokensToServers, testVideoImage, | 11 | getVideoChannelsList, getVideosList, killallServers, rateVideo, removeVideo, ServerInfo, setAccessTokensToServers, testVideoImage, |
12 | updateVideo, uploadVideo, wait, webtorrentAdd | 12 | updateVideo, uploadVideo, wait, webtorrentAdd |
13 | } from '../utils' | 13 | } from '../../utils/index' |
14 | import { createUser } from '../utils/users' | 14 | import { createUser } from '../../utils/users/users' |
15 | import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments' | 15 | import { |
16 | import { viewVideo } from '../utils/videos' | 16 | addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, |
17 | getVideoThreadComments | ||
18 | } from '../../utils/videos/video-comments' | ||
19 | import { viewVideo } from '../../utils/videos/videos' | ||
17 | 20 | ||
18 | const expect = chai.expect | 21 | const expect = chai.expect |
19 | 22 | ||
diff --git a/server/tests/api/services.ts b/server/tests/api/videos/services.ts index 4d480c305..1cda464d9 100644 --- a/server/tests/api/services.ts +++ b/server/tests/api/videos/services.ts | |||
@@ -12,8 +12,8 @@ import { | |||
12 | setAccessTokensToServers, | 12 | setAccessTokensToServers, |
13 | killallServers, | 13 | killallServers, |
14 | getOEmbed | 14 | getOEmbed |
15 | } from '../utils' | 15 | } from '../../utils/index' |
16 | import { runServer } from '../utils/servers' | 16 | import { runServer } from '../../utils/server/servers' |
17 | 17 | ||
18 | describe('Test services', function () { | 18 | describe('Test services', function () { |
19 | let server: ServerInfo = null | 19 | let server: ServerInfo = null |
diff --git a/server/tests/api/single-server.ts b/server/tests/api/videos/single-server.ts index 7f4351f5e..02723654d 100644 --- a/server/tests/api/single-server.ts +++ b/server/tests/api/videos/single-server.ts | |||
@@ -30,8 +30,8 @@ import { | |||
30 | uploadVideo, | 30 | uploadVideo, |
31 | wait, | 31 | wait, |
32 | webtorrentAdd | 32 | webtorrentAdd |
33 | } from '../utils' | 33 | } from '../../utils/index' |
34 | import { viewVideo } from '../utils/videos' | 34 | import { viewVideo } from '../../utils/videos/videos' |
35 | 35 | ||
36 | const expect = chai.expect | 36 | const expect = chai.expect |
37 | 37 | ||
diff --git a/server/tests/api/video-abuse.ts b/server/tests/api/videos/video-abuse.ts index 4a0b6b504..3fcf5d8c7 100644 --- a/server/tests/api/video-abuse.ts +++ b/server/tests/api/videos/video-abuse.ts | |||
@@ -13,8 +13,8 @@ import { | |||
13 | setAccessTokensToServers, | 13 | setAccessTokensToServers, |
14 | uploadVideo, | 14 | uploadVideo, |
15 | wait | 15 | wait |
16 | } from '../utils' | 16 | } from '../../utils/index' |
17 | import { doubleFollow } from '../utils/follows' | 17 | import { doubleFollow } from '../../utils/server/follows' |
18 | 18 | ||
19 | const expect = chai.expect | 19 | const expect = chai.expect |
20 | 20 | ||
diff --git a/server/tests/api/video-blacklist-management.ts b/server/tests/api/videos/video-blacklist-management.ts index 0c636e094..db79784c2 100644 --- a/server/tests/api/video-blacklist-management.ts +++ b/server/tests/api/videos/video-blacklist-management.ts | |||
@@ -16,8 +16,8 @@ import { | |||
16 | setAccessTokensToServers, | 16 | setAccessTokensToServers, |
17 | uploadVideo, | 17 | uploadVideo, |
18 | wait | 18 | wait |
19 | } from '../utils' | 19 | } from '../../utils/index' |
20 | import { doubleFollow } from '../utils/follows' | 20 | import { doubleFollow } from '../../utils/server/follows' |
21 | 21 | ||
22 | const expect = chai.expect | 22 | const expect = chai.expect |
23 | const orderBy = lodash.orderBy | 23 | const orderBy = lodash.orderBy |
diff --git a/server/tests/api/video-blacklist.ts b/server/tests/api/videos/video-blacklist.ts index 3afd8c510..d1cefa5d7 100644 --- a/server/tests/api/video-blacklist.ts +++ b/server/tests/api/videos/video-blacklist.ts | |||
@@ -13,8 +13,8 @@ import { | |||
13 | setAccessTokensToServers, | 13 | setAccessTokensToServers, |
14 | uploadVideo, | 14 | uploadVideo, |
15 | wait | 15 | wait |
16 | } from '../utils' | 16 | } from '../../utils/index' |
17 | import { doubleFollow } from '../utils/follows' | 17 | import { doubleFollow } from '../../utils/server/follows' |
18 | 18 | ||
19 | const expect = chai.expect | 19 | const expect = chai.expect |
20 | 20 | ||
diff --git a/server/tests/api/video-channels.ts b/server/tests/api/videos/video-channels.ts index 2d8efb320..454a96da6 100644 --- a/server/tests/api/video-channels.ts +++ b/server/tests/api/videos/video-channels.ts | |||
@@ -17,8 +17,8 @@ import { | |||
17 | updateVideoChannel, | 17 | updateVideoChannel, |
18 | deleteVideoChannel, | 18 | deleteVideoChannel, |
19 | getVideoChannel | 19 | getVideoChannel |
20 | } from '../utils' | 20 | } from '../../utils/index' |
21 | import { User } from '../../../shared' | 21 | import { User } from '../../../../shared/index' |
22 | 22 | ||
23 | describe('Test a video channels', function () { | 23 | describe('Test a video channels', function () { |
24 | let server: ServerInfo | 24 | let server: ServerInfo |
diff --git a/server/tests/api/video-comments.ts b/server/tests/api/videos/video-comments.ts index f05ca5e81..3b6578f04 100644 --- a/server/tests/api/video-comments.ts +++ b/server/tests/api/videos/video-comments.ts | |||
@@ -2,9 +2,12 @@ | |||
2 | 2 | ||
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 { dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../utils' | 6 | import { dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index' |
7 | import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments' | 7 | import { |
8 | addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, | ||
9 | getVideoThreadComments | ||
10 | } from '../../utils/videos/video-comments' | ||
8 | 11 | ||
9 | const expect = chai.expect | 12 | const expect = chai.expect |
10 | 13 | ||
diff --git a/server/tests/api/video-description.ts b/server/tests/api/videos/video-description.ts index 7ad1c63ae..c2985194c 100644 --- a/server/tests/api/video-description.ts +++ b/server/tests/api/videos/video-description.ts | |||
@@ -14,8 +14,8 @@ import { | |||
14 | updateVideo, | 14 | updateVideo, |
15 | uploadVideo, | 15 | uploadVideo, |
16 | wait | 16 | wait |
17 | } from '../utils' | 17 | } from '../../utils/index' |
18 | import { doubleFollow } from '../utils/follows' | 18 | import { doubleFollow } from '../../utils/server/follows' |
19 | 19 | ||
20 | const expect = chai.expect | 20 | const expect = chai.expect |
21 | 21 | ||
diff --git a/server/tests/api/video-privacy.ts b/server/tests/api/videos/video-privacy.ts index 26847efce..de709f8f1 100644 --- a/server/tests/api/video-privacy.ts +++ b/server/tests/api/videos/video-privacy.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { VideoPrivacy } from '../../../shared/models/videos/video-privacy.enum' | 5 | import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' |
6 | import { | 6 | import { |
7 | flushAndRunMultipleServers, | 7 | flushAndRunMultipleServers, |
8 | flushTests, | 8 | flushTests, |
@@ -12,11 +12,11 @@ import { | |||
12 | setAccessTokensToServers, | 12 | setAccessTokensToServers, |
13 | uploadVideo, | 13 | uploadVideo, |
14 | wait | 14 | wait |
15 | } from '../utils' | 15 | } from '../../utils/index' |
16 | import { doubleFollow } from '../utils/follows' | 16 | import { doubleFollow } from '../../utils/server/follows' |
17 | import { getUserAccessToken } from '../utils/login' | 17 | import { getUserAccessToken } from '../../utils/users/login' |
18 | import { createUser } from '../utils/users' | 18 | import { createUser } from '../../utils/users/users' |
19 | import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../utils/videos' | 19 | import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../utils/videos/videos' |
20 | 20 | ||
21 | const expect = chai.expect | 21 | const expect = chai.expect |
22 | 22 | ||
diff --git a/server/tests/api/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts index 9a6e91b76..27927a594 100644 --- a/server/tests/api/video-transcoder.ts +++ b/server/tests/api/videos/video-transcoder.ts | |||
@@ -15,7 +15,7 @@ import { | |||
15 | killallServers, | 15 | killallServers, |
16 | webtorrentAdd, | 16 | webtorrentAdd, |
17 | getVideo | 17 | getVideo |
18 | } from '../utils' | 18 | } from '../../utils/index' |
19 | 19 | ||
20 | describe('Test video transcoding', function () { | 20 | describe('Test video transcoding', function () { |
21 | let servers: ServerInfo[] = [] | 21 | let servers: ServerInfo[] = [] |