import * as chai from 'chai'
import 'mocha'
import {
+ cleanupTests,
doubleFollow,
+ flushAndRunMultipleServers,
getAccountVideos,
getVideo,
getVideoChannelVideos,
getVideoWithToken,
- flushAndRunMultipleServers,
- killallServers,
ServerInfo,
setAccessTokensToServers,
uploadVideo
-} from '../../../../shared/utils'
-import { unfollow } from '../../../../shared/utils/server/follows'
-import { userLogin } from '../../../../shared/utils/users/login'
-import { createUser } from '../../../../shared/utils/users/users'
+} from '../../../../shared/extra-utils'
+import { unfollow } from '../../../../shared/extra-utils/server/follows'
+import { userLogin } from '../../../../shared/extra-utils/users/login'
+import { createUser } from '../../../../shared/extra-utils/users/users'
const expect = chai.expect
let userAccessToken: string
before(async function () {
- this.timeout(30000)
+ this.timeout(60000)
servers = await flushAndRunMultipleServers(2)
})
it('Should list local account videos', async function () {
- const res = await getAccountVideos(servers[0].url, undefined, 'root@localhost:9001', 0, 5)
+ const res = await getAccountVideos(servers[0].url, undefined, 'root@localhost:' + servers[0].port, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
it('Should list remote account videos', async function () {
- const res = await getAccountVideos(servers[0].url, undefined, 'root@localhost:9002', 0, 5)
+ const res = await getAccountVideos(servers[0].url, undefined, 'root@localhost:' + servers[1].port, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
it('Should list local channel videos', async function () {
- const res = await getVideoChannelVideos(servers[0].url, undefined, 'root_channel@localhost:9001', 0, 5)
+ const videoChannelName = 'root_channel@localhost:' + servers[0].port
+ const res = await getVideoChannelVideos(servers[0].url, undefined, videoChannelName, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
it('Should list remote channel videos', async function () {
- const res = await getVideoChannelVideos(servers[0].url, undefined, 'root_channel@localhost:9002', 0, 5)
+ const videoChannelName = 'root_channel@localhost:' + servers[1].port
+ const res = await getVideoChannelVideos(servers[0].url, undefined, videoChannelName, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
it('Should list local account videos', async function () {
- const res = await getAccountVideos(servers[0].url, userAccessToken, 'root@localhost:9001', 0, 5)
+ const res = await getAccountVideos(servers[0].url, userAccessToken, 'root@localhost:' + servers[0].port, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
it('Should list remote account videos', async function () {
- const res = await getAccountVideos(servers[0].url, userAccessToken, 'root@localhost:9002', 0, 5)
+ const res = await getAccountVideos(servers[0].url, userAccessToken, 'root@localhost:' + servers[1].port, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
it('Should list local channel videos', async function () {
- const res = await getVideoChannelVideos(servers[0].url, userAccessToken, 'root_channel@localhost:9001', 0, 5)
+ const videoChannelName = 'root_channel@localhost:' + servers[0].port
+ const res = await getVideoChannelVideos(servers[0].url, userAccessToken, videoChannelName, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
it('Should list remote channel videos', async function () {
- const res = await getVideoChannelVideos(servers[0].url, userAccessToken, 'root_channel@localhost:9002', 0, 5)
+ const videoChannelName = 'root_channel@localhost:' + servers[1].port
+ const res = await getVideoChannelVideos(servers[0].url, userAccessToken, videoChannelName, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
it('Should list local account videos', async function () {
- const res = await getAccountVideos(servers[0].url, undefined, 'root@localhost:9001', 0, 5)
+ const res = await getAccountVideos(servers[0].url, undefined, 'root@localhost:' + servers[0].port, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
it('Should not list remote account videos', async function () {
- const res = await getAccountVideos(servers[0].url, undefined, 'root@localhost:9002', 0, 5)
+ const res = await getAccountVideos(servers[0].url, undefined, 'root@localhost:' + servers[1].port, 0, 5)
expect(res.body.total).to.equal(0)
expect(res.body.data).to.have.lengthOf(0)
})
it('Should list local channel videos', async function () {
- const res = await getVideoChannelVideos(servers[0].url, undefined, 'root_channel@localhost:9001', 0, 5)
+ const videoChannelName = 'root_channel@localhost:' + servers[0].port
+ const res = await getVideoChannelVideos(servers[0].url, undefined, videoChannelName, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
it('Should not list remote channel videos', async function () {
- const res = await getVideoChannelVideos(servers[0].url, undefined, 'root_channel@localhost:9002', 0, 5)
+ const videoChannelName = 'root_channel@localhost:' + servers[1].port
+ const res = await getVideoChannelVideos(servers[0].url, undefined, videoChannelName, 0, 5)
expect(res.body.total).to.equal(0)
expect(res.body.data).to.have.lengthOf(0)
})
it('Should list local account videos', async function () {
- const res = await getAccountVideos(servers[0].url, userAccessToken, 'root@localhost:9001', 0, 5)
+ const res = await getAccountVideos(servers[0].url, userAccessToken, 'root@localhost:' + servers[0].port, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
it('Should list remote account videos', async function () {
- const res = await getAccountVideos(servers[0].url, userAccessToken, 'root@localhost:9002', 0, 5)
+ const res = await getAccountVideos(servers[0].url, userAccessToken, 'root@localhost:' + servers[1].port, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
it('Should list local channel videos', async function () {
- const res = await getVideoChannelVideos(servers[0].url, userAccessToken, 'root_channel@localhost:9001', 0, 5)
+ const videoChannelName = 'root_channel@localhost:' + servers[0].port
+ const res = await getVideoChannelVideos(servers[0].url, userAccessToken, videoChannelName, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
it('Should list remote channel videos', async function () {
- const res = await getVideoChannelVideos(servers[0].url, userAccessToken, 'root_channel@localhost:9002', 0, 5)
+ const videoChannelName = 'root_channel@localhost:' + servers[1].port
+ const res = await getVideoChannelVideos(servers[0].url, userAccessToken, videoChannelName, 0, 5)
expect(res.body.total).to.equal(1)
expect(res.body.data).to.have.lengthOf(1)
})
after(async function () {
- killallServers(servers)
+ await cleanupTests(servers)
})
})