import * as chai from 'chai'
import 'mocha'
-import { flushTests, killallServers, ServerInfo, setAccessTokensToServers } from './utils'
-import { runServer } from './utils/servers'
-import { makeActivityPubGetRequest } from './utils/activitypub'
+import { flushTests, killallServers, makeActivityPubGetRequest, runServer, ServerInfo, setAccessTokensToServers } from './utils'
const expect = chai.expect
setAccessTokensToServers,
killallServers
} from '../../utils'
-import { getVideosList, uploadVideo } from '../../utils/videos'
+import { getVideosList, uploadVideo } from '../../utils/videos/videos'
describe('Test services API validators', function () {
let server
import 'mocha'
import * as request from 'supertest'
import { flushTests, killallServers, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils'
-import { addVideoCommentThread } from '../../utils/video-comments'
+import { addVideoCommentThread } from '../../utils/videos/video-comments'
describe('Test video comments API validator', function () {
let pathThread: string
// Order of the tests we want to execute
-import './config'
+import './server/config'
import './check-params'
-import './users'
-import './single-server'
-import './video-abuse'
-import './video-blacklist'
-import './video-blacklist-management'
-import './video-description'
-import './video-privacy'
-import './services'
+import './users/users'
+import './videos/single-server'
+import './videos/video-abuse'
+import './videos/video-blacklist'
+import './videos/video-blacklist-management'
+import './videos/video-description'
+import './videos/video-privacy'
+import './videos/services'
// Order of the tests we want to execute
// import './multiple-servers'
-import './video-transcoder'
-import './multiple-servers'
-import './follows'
-import './jobs'
-import './video-comments'
+import './videos/video-transcoder'
+import './videos/multiple-servers'
+import './server/follows'
+import './server/jobs'
+import './videos/video-comments'
flushTests,
runServer,
registerUser
-} from '../utils'
+} from '../../utils/index'
describe('Test config', function () {
let server = null
import * as chai from 'chai'
import 'mocha'
-import { VideoComment, VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model'
+import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
import {
flushAndRunMultipleServers, flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo,
wait
-} from '../utils'
-import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../utils/follows'
-import { getUserAccessToken } from '../utils/login'
-import { dateIsValid, webtorrentAdd } from '../utils/miscs'
-import { createUser } from '../utils/users'
-import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments'
-import { getVideo, rateVideo, testVideoImage } from '../utils/videos'
+} from '../../utils/index'
+import { dateIsValid, webtorrentAdd } from '../../utils/miscs/miscs'
+import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../../utils/server/follows'
+import { getUserAccessToken } from '../../utils/users/login'
+import { createUser } from '../../utils/users/users'
+import {
+ addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads,
+ getVideoThreadComments
+} from '../../utils/videos/video-comments'
+import { getVideo, rateVideo, testVideoImage } from '../../utils/videos/videos'
const expect = chai.expect
import * as chai from 'chai'
import 'mocha'
-import { flushTests, killallServers, ServerInfo, setAccessTokensToServers, wait } from '../utils'
-import { doubleFollow } from '../utils/follows'
-import { getJobsList, getJobsListPaginationAndSort } from '../utils/jobs'
-import { flushAndRunMultipleServers } from '../utils/servers'
-import { uploadVideo } from '../utils/videos'
-import { dateIsValid } from '../utils/miscs'
+import { flushTests, killallServers, ServerInfo, setAccessTokensToServers, wait } from '../../utils/index'
+import { doubleFollow } from '../../utils/server/follows'
+import { getJobsList, getJobsListPaginationAndSort } from '../../utils/server/jobs'
+import { flushAndRunMultipleServers } from '../../utils/server/servers'
+import { uploadVideo } from '../../utils/videos/videos'
+import { dateIsValid } from '../../utils/miscs/miscs'
const expect = chai.expect
import * as chai from 'chai'
import 'mocha'
-import { UserRole } from '../../../shared'
+import { UserRole } from '../../../../shared/index'
import {
createUser,
flushTests,
updateMyUser,
updateUser,
uploadVideo
-} from '../utils'
-import { follow } from '../utils/follows'
-import { getMyVideos } from '../utils/videos'
-import { setAccessTokensToServers } from '../utils/login'
+} from '../../utils/index'
+import { follow } from '../../utils/server/follows'
+import { getMyVideos } from '../../utils/videos/videos'
+import { setAccessTokensToServers } from '../../utils/users/login'
const expect = chai.expect
import 'mocha'
import { join } from 'path'
import * as request from 'supertest'
-import { VideoComment, VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model'
+import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
import {
addVideoChannel, dateIsValid, doubleFollow, flushAndRunMultipleServers, flushTests, getUserAccessToken, getVideo,
getVideoChannelsList, getVideosList, killallServers, rateVideo, removeVideo, ServerInfo, setAccessTokensToServers, testVideoImage,
updateVideo, uploadVideo, wait, webtorrentAdd
-} from '../utils'
-import { createUser } from '../utils/users'
-import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments'
-import { viewVideo } from '../utils/videos'
+} from '../../utils/index'
+import { createUser } from '../../utils/users/users'
+import {
+ addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads,
+ getVideoThreadComments
+} from '../../utils/videos/video-comments'
+import { viewVideo } from '../../utils/videos/videos'
const expect = chai.expect
setAccessTokensToServers,
killallServers,
getOEmbed
-} from '../utils'
-import { runServer } from '../utils/servers'
+} from '../../utils/index'
+import { runServer } from '../../utils/server/servers'
describe('Test services', function () {
let server: ServerInfo = null
uploadVideo,
wait,
webtorrentAdd
-} from '../utils'
-import { viewVideo } from '../utils/videos'
+} from '../../utils/index'
+import { viewVideo } from '../../utils/videos/videos'
const expect = chai.expect
setAccessTokensToServers,
uploadVideo,
wait
-} from '../utils'
-import { doubleFollow } from '../utils/follows'
+} from '../../utils/index'
+import { doubleFollow } from '../../utils/server/follows'
const expect = chai.expect
setAccessTokensToServers,
uploadVideo,
wait
-} from '../utils'
-import { doubleFollow } from '../utils/follows'
+} from '../../utils/index'
+import { doubleFollow } from '../../utils/server/follows'
const expect = chai.expect
const orderBy = lodash.orderBy
setAccessTokensToServers,
uploadVideo,
wait
-} from '../utils'
-import { doubleFollow } from '../utils/follows'
+} from '../../utils/index'
+import { doubleFollow } from '../../utils/server/follows'
const expect = chai.expect
updateVideoChannel,
deleteVideoChannel,
getVideoChannel
-} from '../utils'
-import { User } from '../../../shared'
+} from '../../utils/index'
+import { User } from '../../../../shared/index'
describe('Test a video channels', function () {
let server: ServerInfo
import * as chai from 'chai'
import 'mocha'
-import { VideoComment, VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model'
-import { dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../utils'
-import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments'
+import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
+import { dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index'
+import {
+ addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads,
+ getVideoThreadComments
+} from '../../utils/videos/video-comments'
const expect = chai.expect
updateVideo,
uploadVideo,
wait
-} from '../utils'
-import { doubleFollow } from '../utils/follows'
+} from '../../utils/index'
+import { doubleFollow } from '../../utils/server/follows'
const expect = chai.expect
import * as chai from 'chai'
import 'mocha'
-import { VideoPrivacy } from '../../../shared/models/videos/video-privacy.enum'
+import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum'
import {
flushAndRunMultipleServers,
flushTests,
setAccessTokensToServers,
uploadVideo,
wait
-} from '../utils'
-import { doubleFollow } from '../utils/follows'
-import { getUserAccessToken } from '../utils/login'
-import { createUser } from '../utils/users'
-import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../utils/videos'
+} from '../../utils/index'
+import { doubleFollow } from '../../utils/server/follows'
+import { getUserAccessToken } from '../../utils/users/login'
+import { createUser } from '../../utils/users/users'
+import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../utils/videos/videos'
const expect = chai.expect
killallServers,
webtorrentAdd,
getVideo
-} from '../utils'
+} from '../../utils/index'
describe('Test video transcoding', function () {
let servers: ServerInfo[] = []
import { exec } from 'child_process'
-import { ServerInfo } from './servers'
+import { ServerInfo } from '../server/servers'
function getEnvCli (server?: ServerInfo) {
return `NODE_ENV=test NODE_APP_INSTANCE=${server.serverNumber}`
-export * from './activitypub'
-export * from './cli'
-export * from './clients'
-export * from './config'
-export * from './login'
-export * from './miscs'
-export * from './follows'
-export * from './requests'
-export * from './servers'
-export * from './services'
-export * from './users'
-export * from './video-abuses'
-export * from './video-blacklist'
-export * from './video-channels'
-export * from './videos'
+export * from './server/activitypub'
+export * from './cli/cli'
+export * from './server/clients'
+export * from './server/config'
+export * from './users/login'
+export * from './miscs/miscs'
+export * from './server/follows'
+export * from './requests/requests'
+export * from './server/servers'
+export * from './videos/services'
+export * from './users/users'
+export * from './videos/video-abuses'
+export * from './videos/video-blacklist'
+export * from './videos/video-channels'
+export * from './videos/videos'
import * as request from 'supertest'
-import { wait } from './miscs'
+import { wait } from '../miscs/miscs'
import { ServerInfo } from './servers'
function getFollowersListPaginationAndSort (url: string, start: number, count: number, sort: string) {
import * as request from 'supertest'
-import { ServerInfo } from './servers'
+import { ServerInfo } from '../server/servers'
type Client = { id: string, secret: string }
type User = { username: string, password: string }
import * as request from 'supertest'
-import { UserRole } from '../../../shared'
+import { UserRole } from '../../../../shared/index'
function createUser (
url: string,
import { readFile } from 'fs'
-import * as request from 'supertest'
-import { join, isAbsolute } from 'path'
import * as parseTorrent from 'parse-torrent'
-
-import { makeGetRequest } from './requests'
-import { readFilePromise } from './miscs'
-import { ServerInfo } from './servers'
-import { getMyUserInformation } from './users'
-import { VideoPrivacy } from '../../../shared'
+import { isAbsolute, join } from 'path'
+import * as request from 'supertest'
+import { getMyUserInformation, makeGetRequest, readFilePromise, ServerInfo } from '../'
+import { VideoPrivacy } from '../../../../shared/models/videos'
type VideoAttributes = {
name?: string