aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-11-19 17:08:18 +0100
committerChocobozzz <me@florianbigard.com>2018-11-19 17:08:18 +0100
commitd175a6f7ab9dd53e36f9f52769ac02dbfdc57e3e (patch)
tree1c313c3a3e0680101516dea3a787cd307006c76d /server/tests/utils
parent0b2f03d3712f438f67eccf86b67acd047284f9b4 (diff)
downloadPeerTube-d175a6f7ab9dd53e36f9f52769ac02dbfdc57e3e.tar.gz
PeerTube-d175a6f7ab9dd53e36f9f52769ac02dbfdc57e3e.tar.zst
PeerTube-d175a6f7ab9dd53e36f9f52769ac02dbfdc57e3e.zip
Cleanup tests imports
Diffstat (limited to 'server/tests/utils')
-rw-r--r--server/tests/utils/index.ts1
-rw-r--r--server/tests/utils/requests/check-api-params.ts2
-rw-r--r--server/tests/utils/search/videos.ts2
-rw-r--r--server/tests/utils/server/config.ts2
-rw-r--r--server/tests/utils/server/jobs.ts3
-rw-r--r--server/tests/utils/server/stats.ts2
-rw-r--r--server/tests/utils/users/accounts.ts2
-rw-r--r--server/tests/utils/users/blocklist.ts2
-rw-r--r--server/tests/utils/users/user-subscriptions.ts2
-rw-r--r--server/tests/utils/users/users.ts2
-rw-r--r--server/tests/utils/videos/video-abuses.ts2
-rw-r--r--server/tests/utils/videos/video-captions.ts4
-rw-r--r--server/tests/utils/videos/video-channels.ts2
-rw-r--r--server/tests/utils/videos/video-comments.ts2
-rw-r--r--server/tests/utils/videos/video-imports.ts2
-rw-r--r--server/tests/utils/videos/videos.ts4
16 files changed, 18 insertions, 18 deletions
diff --git a/server/tests/utils/index.ts b/server/tests/utils/index.ts
index 905d93823..8349631c9 100644
--- a/server/tests/utils/index.ts
+++ b/server/tests/utils/index.ts
@@ -7,7 +7,6 @@ export * from './miscs/miscs'
7export * from './miscs/stubs' 7export * from './miscs/stubs'
8export * from './server/follows' 8export * from './server/follows'
9export * from './requests/requests' 9export * from './requests/requests'
10export * from './requests/activitypub'
11export * from './server/servers' 10export * from './server/servers'
12export * from './videos/services' 11export * from './videos/services'
13export * from './users/users' 12export * from './users/users'
diff --git a/server/tests/utils/requests/check-api-params.ts b/server/tests/utils/requests/check-api-params.ts
index edb47e0e9..a2a549682 100644
--- a/server/tests/utils/requests/check-api-params.ts
+++ b/server/tests/utils/requests/check-api-params.ts
@@ -1,5 +1,5 @@
1import { makeGetRequest } from './requests' 1import { makeGetRequest } from './requests'
2import { immutableAssign } from '..' 2import { immutableAssign } from '../miscs/miscs'
3 3
4function checkBadStartPagination (url: string, path: string, token?: string, query = {}) { 4function checkBadStartPagination (url: string, path: string, token?: string, query = {}) {
5 return makeGetRequest({ 5 return makeGetRequest({
diff --git a/server/tests/utils/search/videos.ts b/server/tests/utils/search/videos.ts
index 3a0c10e42..8c0037ccc 100644
--- a/server/tests/utils/search/videos.ts
+++ b/server/tests/utils/search/videos.ts
@@ -2,7 +2,7 @@
2 2
3import * as request from 'supertest' 3import * as request from 'supertest'
4import { VideosSearchQuery } from '../../../../shared/models/search' 4import { VideosSearchQuery } from '../../../../shared/models/search'
5import { immutableAssign } from '..' 5import { immutableAssign } from '../miscs/miscs'
6 6
7function searchVideo (url: string, search: string) { 7function searchVideo (url: string, search: string) {
8 const path = '/api/v1/search/videos' 8 const path = '/api/v1/search/videos'
diff --git a/server/tests/utils/server/config.ts b/server/tests/utils/server/config.ts
index b85e02ab7..aa3100d34 100644
--- a/server/tests/utils/server/config.ts
+++ b/server/tests/utils/server/config.ts
@@ -1,4 +1,4 @@
1import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../' 1import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../requests/requests'
2import { CustomConfig } from '../../../../shared/models/server/custom-config.model' 2import { CustomConfig } from '../../../../shared/models/server/custom-config.model'
3 3
4function getConfig (url: string) { 4function getConfig (url: string) {
diff --git a/server/tests/utils/server/jobs.ts b/server/tests/utils/server/jobs.ts
index 4c02cace5..26180ec72 100644
--- a/server/tests/utils/server/jobs.ts
+++ b/server/tests/utils/server/jobs.ts
@@ -1,6 +1,7 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2import { Job, JobState } from '../../../../shared/models' 2import { Job, JobState } from '../../../../shared/models'
3import { ServerInfo, wait } from '../index' 3import { ServerInfo } from './servers'
4import { wait } from '../miscs/miscs'
4 5
5function getJobsList (url: string, accessToken: string, state: JobState) { 6function getJobsList (url: string, accessToken: string, state: JobState) {
6 const path = '/api/v1/jobs/' + state 7 const path = '/api/v1/jobs/' + state
diff --git a/server/tests/utils/server/stats.ts b/server/tests/utils/server/stats.ts
index 01989d952..6f079ad18 100644
--- a/server/tests/utils/server/stats.ts
+++ b/server/tests/utils/server/stats.ts
@@ -1,4 +1,4 @@
1import { makeGetRequest } from '../' 1import { makeGetRequest } from '../requests/requests'
2 2
3function getStats (url: string, useCache = false) { 3function getStats (url: string, useCache = false) {
4 const path = '/api/v1/server/stats' 4 const path = '/api/v1/server/stats'
diff --git a/server/tests/utils/users/accounts.ts b/server/tests/utils/users/accounts.ts
index f82b8d906..257fa5b27 100644
--- a/server/tests/utils/users/accounts.ts
+++ b/server/tests/utils/users/accounts.ts
@@ -4,7 +4,7 @@ import { expect } from 'chai'
4import { existsSync, readdir } from 'fs-extra' 4import { existsSync, readdir } from 'fs-extra'
5import { join } from 'path' 5import { join } from 'path'
6import { Account } from '../../../../shared/models/actors' 6import { Account } from '../../../../shared/models/actors'
7import { root } from '../index' 7import { root } from '../miscs/miscs'
8import { makeGetRequest } from '../requests/requests' 8import { makeGetRequest } from '../requests/requests'
9 9
10function getAccountsList (url: string, sort = '-createdAt', statusCodeExpected = 200) { 10function getAccountsList (url: string, sort = '-createdAt', statusCodeExpected = 200) {
diff --git a/server/tests/utils/users/blocklist.ts b/server/tests/utils/users/blocklist.ts
index 35b537571..0ead5e5f6 100644
--- a/server/tests/utils/users/blocklist.ts
+++ b/server/tests/utils/users/blocklist.ts
@@ -1,6 +1,6 @@
1/* tslint:disable:no-unused-expression */ 1/* tslint:disable:no-unused-expression */
2 2
3import { makeDeleteRequest, makePostBodyRequest } from '../index' 3import { makeDeleteRequest, makePostBodyRequest } from '../requests/requests'
4import { makeGetRequest } from '../requests/requests' 4import { makeGetRequest } from '../requests/requests'
5 5
6function getAccountBlocklistByAccount ( 6function getAccountBlocklistByAccount (
diff --git a/server/tests/utils/users/user-subscriptions.ts b/server/tests/utils/users/user-subscriptions.ts
index b0e7da7cc..7148fbfca 100644
--- a/server/tests/utils/users/user-subscriptions.ts
+++ b/server/tests/utils/users/user-subscriptions.ts
@@ -1,4 +1,4 @@
1import { makeDeleteRequest, makeGetRequest, makePostBodyRequest } from '../' 1import { makeDeleteRequest, makeGetRequest, makePostBodyRequest } from '../requests/requests'
2 2
3function addUserSubscription (url: string, token: string, targetUri: string, statusCodeExpected = 204) { 3function addUserSubscription (url: string, token: string, targetUri: string, statusCodeExpected = 204) {
4 const path = '/api/v1/users/me/subscriptions' 4 const path = '/api/v1/users/me/subscriptions'
diff --git a/server/tests/utils/users/users.ts b/server/tests/utils/users/users.ts
index d77233d62..2c21a9ecf 100644
--- a/server/tests/utils/users/users.ts
+++ b/server/tests/utils/users/users.ts
@@ -1,5 +1,5 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2import { makePostBodyRequest, makePutBodyRequest, updateAvatarRequest } from '../' 2import { makePostBodyRequest, makePutBodyRequest, updateAvatarRequest } from '../requests/requests'
3 3
4import { UserRole } from '../../../../shared/index' 4import { UserRole } from '../../../../shared/index'
5import { NSFWPolicyType } from '../../../../shared/models/videos/nsfw-policy.type' 5import { NSFWPolicyType } from '../../../../shared/models/videos/nsfw-policy.type'
diff --git a/server/tests/utils/videos/video-abuses.ts b/server/tests/utils/videos/video-abuses.ts
index 14907e6a0..4ad82ad8c 100644
--- a/server/tests/utils/videos/video-abuses.ts
+++ b/server/tests/utils/videos/video-abuses.ts
@@ -1,6 +1,6 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2import { VideoAbuseUpdate } from '../../../../shared/models/videos/abuse/video-abuse-update.model' 2import { VideoAbuseUpdate } from '../../../../shared/models/videos/abuse/video-abuse-update.model'
3import { makeDeleteRequest, makePutBodyRequest } from '..' 3import { makeDeleteRequest, makePutBodyRequest } from '../requests/requests'
4 4
5function reportVideoAbuse (url: string, token: string, videoId: number | string, reason: string, specialStatus = 200) { 5function reportVideoAbuse (url: string, token: string, videoId: number | string, reason: string, specialStatus = 200) {
6 const path = '/api/v1/videos/' + videoId + '/abuse' 6 const path = '/api/v1/videos/' + videoId + '/abuse'
diff --git a/server/tests/utils/videos/video-captions.ts b/server/tests/utils/videos/video-captions.ts
index 41e52be07..8d67f617b 100644
--- a/server/tests/utils/videos/video-captions.ts
+++ b/server/tests/utils/videos/video-captions.ts
@@ -1,7 +1,7 @@
1import { makeDeleteRequest, makeGetRequest } from '../' 1import { makeDeleteRequest, makeGetRequest, makeUploadRequest } from '../requests/requests'
2import { buildAbsoluteFixturePath, makeUploadRequest } from '../index'
3import * as request from 'supertest' 2import * as request from 'supertest'
4import * as chai from 'chai' 3import * as chai from 'chai'
4import { buildAbsoluteFixturePath } from '../miscs/miscs'
5 5
6const expect = chai.expect 6const expect = chai.expect
7 7
diff --git a/server/tests/utils/videos/video-channels.ts b/server/tests/utils/videos/video-channels.ts
index 092985777..70e8d1a6b 100644
--- a/server/tests/utils/videos/video-channels.ts
+++ b/server/tests/utils/videos/video-channels.ts
@@ -1,6 +1,6 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared/models/videos' 2import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared/models/videos'
3import { updateAvatarRequest } from '../index' 3import { updateAvatarRequest } from '../requests/requests'
4 4
5function getVideoChannelsList (url: string, start: number, count: number, sort?: string) { 5function getVideoChannelsList (url: string, start: number, count: number, sort?: string) {
6 const path = '/api/v1/video-channels' 6 const path = '/api/v1/video-channels'
diff --git a/server/tests/utils/videos/video-comments.ts b/server/tests/utils/videos/video-comments.ts
index 7d4cae364..0ebf69ced 100644
--- a/server/tests/utils/videos/video-comments.ts
+++ b/server/tests/utils/videos/video-comments.ts
@@ -1,5 +1,5 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2import { makeDeleteRequest } from '../' 2import { makeDeleteRequest } from '../requests/requests'
3 3
4function getVideoCommentThreads (url: string, videoId: number | string, start: number, count: number, sort?: string, token?: string) { 4function getVideoCommentThreads (url: string, videoId: number | string, start: number, count: number, sort?: string, token?: string) {
5 const path = '/api/v1/videos/' + videoId + '/comment-threads' 5 const path = '/api/v1/videos/' + videoId + '/comment-threads'
diff --git a/server/tests/utils/videos/video-imports.ts b/server/tests/utils/videos/video-imports.ts
index 59dfd481a..eb985a5b1 100644
--- a/server/tests/utils/videos/video-imports.ts
+++ b/server/tests/utils/videos/video-imports.ts
@@ -1,5 +1,5 @@
1import { VideoImportCreate } from '../../../../shared/models/videos' 1import { VideoImportCreate } from '../../../../shared/models/videos'
2import { makeGetRequest, makeUploadRequest } from '..' 2import { makeGetRequest, makeUploadRequest } from '../requests/requests'
3 3
4function getYoutubeVideoUrl () { 4function getYoutubeVideoUrl () {
5 return 'https://youtu.be/msX3jv1XdvM' 5 return 'https://youtu.be/msX3jv1XdvM'
diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts
index 87c385f38..d6c3e5dac 100644
--- a/server/tests/utils/videos/videos.ts
+++ b/server/tests/utils/videos/videos.ts
@@ -17,8 +17,8 @@ import {
17 testImage 17 testImage
18} from '../' 18} from '../'
19import { VideoDetails, VideoPrivacy } from '../../../../shared/models/videos' 19import { VideoDetails, VideoPrivacy } from '../../../../shared/models/videos'
20import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../initializers' 20import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../initializers/constants'
21import { dateIsValid, webtorrentAdd } from '../index' 21import { dateIsValid, webtorrentAdd } from '../miscs/miscs'
22 22
23type VideoAttributes = { 23type VideoAttributes = {
24 name?: string 24 name?: string