1 /* tslint:disable:no-unused-expression */
4 import * as chai from 'chai'
5 import { join } from "path"
6 import * as request from 'supertest'
10 flushAndRunMultipleServers,
18 setAccessTokensToServers,
29 import { createUser } from '../utils/users'
30 import { viewVideo } from '../utils/videos'
32 const expect = chai.expect
34 describe('Test multiple servers', function () {
35 let servers: ServerInfo[] = []
38 let videoChannelId: number
40 before(async function () {
43 servers = await flushAndRunMultipleServers(3)
45 // Get the access tokens
46 await setAccessTokensToServers(servers)
48 const videoChannel = {
50 description: 'super channel'
52 await addVideoChannel(servers[0].url, servers[0].accessToken, videoChannel)
53 const channelRes = await getVideoChannelsList(servers[0].url, 0, 1)
54 videoChannelId = channelRes.body.data[0].id
56 // Server 1 and server 2 follow each other
57 await doubleFollow(servers[0], servers[1])
58 // Server 1 and server 3 follow each other
59 await doubleFollow(servers[0], servers[2])
60 // Server 2 and server 3 follow each other
61 await doubleFollow(servers[1], servers[2])
64 it('Should not have videos for all servers', async function () {
65 for (const server of servers) {
66 const res = await getVideosList(server.url)
67 const videos = res.body.data
68 expect(videos).to.be.an('array')
69 expect(videos.length).to.equal(0)
73 describe('Should upload the video and propagate on each server', function () {
74 it('Should upload the video on server 1 and propagate on each server', async function () {
77 const videoAttributes = {
78 name: 'my super name for server 1',
83 description: 'my super description for server 1',
84 tags: [ 'tag1p1', 'tag2p1' ],
85 channelId: videoChannelId,
86 fixture: 'video_short1.webm'
88 await uploadVideo(servers[0].url, servers[0].accessToken, videoAttributes)
92 // All servers should have this video
93 for (const server of servers) {
96 const res = await getVideosList(server.url)
98 const videos = res.body.data
99 expect(videos).to.be.an('array')
100 expect(videos.length).to.equal(1)
101 const video = videos[0]
102 expect(video.name).to.equal('my super name for server 1')
103 expect(video.category).to.equal(5)
104 expect(video.categoryLabel).to.equal('Sports')
105 expect(video.licence).to.equal(4)
106 expect(video.licenceLabel).to.equal('Attribution - Non Commercial')
107 expect(video.language).to.equal(9)
108 expect(video.languageLabel).to.equal('Japanese')
109 expect(video.nsfw).to.be.ok
110 expect(video.description).to.equal('my super description for server 1')
111 expect(video.serverHost).to.equal('localhost:9001')
112 expect(video.duration).to.equal(10)
113 expect(video.tags).to.deep.equal([ 'tag1p1', 'tag2p1' ])
114 expect(dateIsValid(video.createdAt)).to.be.true
115 expect(dateIsValid(video.updatedAt)).to.be.true
116 expect(video.accountName).to.equal('root')
118 const res2 = await getVideo(server.url, video.uuid)
119 const videoDetails = res2.body
121 expect(videoDetails.channel.name).to.equal('my channel')
122 expect(videoDetails.channel.description).to.equal('super channel')
123 expect(videoDetails.account.name).to.equal('root')
124 expect(dateIsValid(videoDetails.channel.createdAt)).to.be.true
125 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true
126 expect(videoDetails.files).to.have.lengthOf(1)
128 const file = videoDetails.files[0]
129 const magnetUri = file.magnetUri
130 expect(file.magnetUri).to.have.lengthOf.above(2)
131 expect(file.torrentUrl).to
132 .equal(`http://${videoDetails.serverHost}/static/torrents/${videoDetails.uuid}-${file.resolution}.torrent`)
133 expect(file.fileUrl).to.equal(`http://${videoDetails.serverHost}/static/webseed/${videoDetails.uuid}-${file.resolution}.webm`)
134 expect(file.resolution).to.equal(720)
135 expect(file.resolutionLabel).to.equal('720p')
136 expect(file.size).to.equal(572456)
138 if (server.url !== 'http://localhost:9001') {
139 expect(video.isLocal).to.be.false
140 expect(videoDetails.channel.isLocal).to.be.false
142 expect(video.isLocal).to.be.true
143 expect(videoDetails.channel.isLocal).to.be.true
146 // All servers should have the same magnet Uri
147 if (baseMagnet === null) {
148 baseMagnet = magnetUri
150 expect(baseMagnet).to.equal(magnetUri)
153 const test = await testVideoImage(server.url, 'video_short1.webm', video.thumbnailPath)
154 expect(test).to.equal(true)
158 it('Should upload the video on server 2 and propagate on each server', async function () {
163 password: 'super_password'
165 await createUser(servers[1].url, servers[1].accessToken, user.username, user.password)
166 const userAccessToken = await getUserAccessToken(servers[1], user)
168 const videoAttributes = {
169 name: 'my super name for server 2',
174 description: 'my super description for server 2',
175 tags: [ 'tag1p2', 'tag2p2', 'tag3p2' ],
176 fixture: 'video_short2.webm'
178 await uploadVideo(servers[1].url, userAccessToken, videoAttributes)
183 // All servers should have this video
184 for (const server of servers) {
187 const res = await getVideosList(server.url)
189 const videos = res.body.data
190 expect(videos).to.be.an('array')
191 expect(videos.length).to.equal(2)
192 const video = videos[1]
193 expect(video.name).to.equal('my super name for server 2')
194 expect(video.category).to.equal(4)
195 expect(video.categoryLabel).to.equal('Art')
196 expect(video.licence).to.equal(3)
197 expect(video.licenceLabel).to.equal('Attribution - No Derivatives')
198 expect(video.language).to.equal(11)
199 expect(video.languageLabel).to.equal('German')
200 expect(video.nsfw).to.be.true
201 expect(video.description).to.equal('my super description for server 2')
202 expect(video.serverHost).to.equal('localhost:9002')
203 expect(video.duration).to.equal(5)
204 expect(video.tags).to.deep.equal([ 'tag1p2', 'tag2p2', 'tag3p2' ])
205 expect(dateIsValid(video.createdAt)).to.be.true
206 expect(dateIsValid(video.updatedAt)).to.be.true
207 expect(video.accountName).to.equal('user1')
209 if (server.url !== 'http://localhost:9002') {
210 expect(video.isLocal).to.be.false
212 expect(video.isLocal).to.be.true
215 const res2 = await getVideo(server.url, video.uuid)
216 const videoDetails = res2.body
218 expect(videoDetails.channel.name).to.equal('Default user1 channel')
219 expect(dateIsValid(videoDetails.channel.createdAt)).to.be.true
220 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true
222 expect(videoDetails.files).to.have.lengthOf(4)
224 // Check common attributes
225 for (const file of videoDetails.files) {
226 expect(file.magnetUri).to.have.lengthOf.above(2)
228 // All servers should have the same magnet Uri
229 if (baseMagnet[file.resolution] === undefined) {
230 baseMagnet[file.resolution] = file.magnet
232 expect(baseMagnet[file.resolution]).to.equal(file.magnet)
236 const file240p = videoDetails.files.find(f => f.resolution === 240)
237 expect(file240p).not.to.be.undefined
238 expect(file240p.resolutionLabel).to.equal('240p')
239 expect(file240p.size).to.be.above(180000).and.below(200000)
241 const file360p = videoDetails.files.find(f => f.resolution === 360)
242 expect(file360p).not.to.be.undefined
243 expect(file360p.resolutionLabel).to.equal('360p')
244 expect(file360p.size).to.be.above(270000).and.below(290000)
246 const file480p = videoDetails.files.find(f => f.resolution === 480)
247 expect(file480p).not.to.be.undefined
248 expect(file480p.resolutionLabel).to.equal('480p')
249 expect(file480p.size).to.be.above(380000).and.below(400000)
251 const file720p = videoDetails.files.find(f => f.resolution === 720)
252 expect(file720p).not.to.be.undefined
253 expect(file720p.resolutionLabel).to.equal('720p')
254 expect(file720p.size).to.be.above(700000).and.below(7200000)
256 const test = await testVideoImage(server.url, 'video_short2.webm', videoDetails.thumbnailPath)
257 expect(test).to.equal(true)
261 it('Should upload two videos on server 3 and propagate on each server', async function () {
264 const videoAttributes1 = {
265 name: 'my super name for server 3',
270 description: 'my super description for server 3',
272 fixture: 'video_short3.webm'
274 await uploadVideo(servers[2].url, servers[2].accessToken, videoAttributes1)
276 const videoAttributes2 = {
277 name: 'my super name for server 3-2',
282 description: 'my super description for server 3-2',
283 tags: [ 'tag2p3', 'tag3p3', 'tag4p3' ],
284 fixture: 'video_short.webm'
286 await uploadVideo(servers[2].url, servers[2].accessToken, videoAttributes2)
290 let baseMagnet = null
291 // All servers should have this video
292 for (const server of servers) {
293 const res = await getVideosList(server.url)
295 const videos = res.body.data
296 expect(videos).to.be.an('array')
297 expect(videos.length).to.equal(4)
299 // We not sure about the order of the two last uploads
302 if (videos[2].name === 'my super name for server 3') {
310 expect(video1.name).to.equal('my super name for server 3')
311 expect(video1.category).to.equal(6)
312 expect(video1.categoryLabel).to.equal('Travels')
313 expect(video1.licence).to.equal(5)
314 expect(video1.licenceLabel).to.equal('Attribution - Non Commercial - Share Alike')
315 expect(video1.language).to.equal(11)
316 expect(video1.languageLabel).to.equal('German')
317 expect(video1.nsfw).to.be.ok
318 expect(video1.description).to.equal('my super description for server 3')
319 expect(video1.serverHost).to.equal('localhost:9003')
320 expect(video1.duration).to.equal(5)
321 expect(video1.tags).to.deep.equal([ 'tag1p3' ])
322 expect(video1.accountName).to.equal('root')
323 expect(dateIsValid(video1.createdAt)).to.be.true
324 expect(dateIsValid(video1.updatedAt)).to.be.true
326 const res2 = await getVideo(server.url, video1.id)
327 const video1Details = res2.body
328 expect(video1Details.files).to.have.lengthOf(1)
330 const file1 = video1Details.files[0]
331 expect(file1.magnetUri).to.have.lengthOf.above(2)
332 expect(file1.resolution).to.equal(720)
333 expect(file1.resolutionLabel).to.equal('720p')
334 expect(file1.size).to.equal(292677)
336 expect(video2.name).to.equal('my super name for server 3-2')
337 expect(video2.category).to.equal(7)
338 expect(video2.categoryLabel).to.equal('Gaming')
339 expect(video2.licence).to.equal(6)
340 expect(video2.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives')
341 expect(video2.language).to.equal(12)
342 expect(video2.languageLabel).to.equal('Korean')
343 expect(video2.nsfw).to.be.false
344 expect(video2.description).to.equal('my super description for server 3-2')
345 expect(video2.serverHost).to.equal('localhost:9003')
346 expect(video2.duration).to.equal(5)
347 expect(video2.tags).to.deep.equal([ 'tag2p3', 'tag3p3', 'tag4p3' ])
348 expect(video2.accountName).to.equal('root')
349 expect(dateIsValid(video2.createdAt)).to.be.true
350 expect(dateIsValid(video2.updatedAt)).to.be.true
352 const res3 = await getVideo(server.url, video2.id)
353 const video2Details = res3.body
355 expect(video2Details.files).to.have.lengthOf(1)
357 const file2 = video2Details.files[0]
358 const magnetUri2 = file2.magnetUri
359 expect(file2.magnetUri).to.have.lengthOf.above(2)
360 expect(file2.resolution).to.equal(720)
361 expect(file2.resolutionLabel).to.equal('720p')
362 expect(file2.size).to.equal(218910)
364 if (server.url !== 'http://localhost:9003') {
365 expect(video1.isLocal).to.be.false
366 expect(video2.isLocal).to.be.false
368 expect(video1.isLocal).to.be.true
369 expect(video2.isLocal).to.be.true
372 // All servers should have the same magnet Uri
373 if (baseMagnet === null) {
374 baseMagnet = magnetUri2
376 expect(baseMagnet).to.equal(magnetUri2)
379 const test1 = await testVideoImage(server.url, 'video_short3.webm', video1.thumbnailPath)
380 expect(test1).to.equal(true)
382 const test2 = await testVideoImage(server.url, 'video_short.webm', video2.thumbnailPath)
383 expect(test2).to.equal(true)
388 describe('Should seed the uploaded video', function () {
389 it('Should add the file 1 by asking server 3', async function () {
392 const res = await getVideosList(servers[2].url)
394 const video = res.body.data[0]
395 toRemove.push(res.body.data[2])
396 toRemove.push(res.body.data[3])
398 const res2 = await getVideo(servers[2].url, video.id)
399 const videoDetails = res2.body
401 const torrent = await webtorrentAdd(videoDetails.files[0].magnetUri)
402 expect(torrent.files).to.be.an('array')
403 expect(torrent.files.length).to.equal(1)
404 expect(torrent.files[0].path).to.exist.and.to.not.equal('')
407 it('Should add the file 2 by asking server 1', async function () {
410 const res = await getVideosList(servers[0].url)
412 const video = res.body.data[1]
413 const res2 = await getVideo(servers[0].url, video.id)
414 const videoDetails = res2.body
416 const torrent = await webtorrentAdd(videoDetails.files[0].magnetUri)
417 expect(torrent.files).to.be.an('array')
418 expect(torrent.files.length).to.equal(1)
419 expect(torrent.files[0].path).to.exist.and.to.not.equal('')
422 it('Should add the file 3 by asking server 2', async function () {
425 const res = await getVideosList(servers[1].url)
427 const video = res.body.data[2]
428 const res2 = await getVideo(servers[1].url, video.id)
429 const videoDetails = res2.body
431 const torrent = await webtorrentAdd(videoDetails.files[0].magnetUri)
432 expect(torrent.files).to.be.an('array')
433 expect(torrent.files.length).to.equal(1)
434 expect(torrent.files[0].path).to.exist.and.to.not.equal('')
437 it('Should add the file 3-2 by asking server 1', async function () {
440 const res = await getVideosList(servers[0].url)
442 const video = res.body.data[3]
443 const res2 = await getVideo(servers[0].url, video.id)
444 const videoDetails = res2.body
446 const torrent = await webtorrentAdd(videoDetails.files[0].magnetUri)
447 expect(torrent.files).to.be.an('array')
448 expect(torrent.files.length).to.equal(1)
449 expect(torrent.files[0].path).to.exist.and.to.not.equal('')
452 it('Should add the file 2 in 360p by asking server 1', async function () {
455 const res = await getVideosList(servers[0].url)
457 const video = res.body.data.find(v => v.name === 'my super name for server 2')
458 const res2 = await getVideo(servers[0].url, video.id)
459 const videoDetails = res2.body
461 const file = videoDetails.files.find(f => f.resolution === 360)
462 expect(file).not.to.be.undefined
464 const torrent = await webtorrentAdd(file.magnetUri)
465 expect(torrent.files).to.be.an('array')
466 expect(torrent.files.length).to.equal(1)
467 expect(torrent.files[0].path).to.exist.and.to.not.equal('')
471 describe('Should update video views, likes and dislikes', function () {
472 let localVideosServer3 = []
473 let remoteVideosServer1 = []
474 let remoteVideosServer2 = []
475 let remoteVideosServer3 = []
477 before(async function () {
478 const res1 = await getVideosList(servers[0].url)
479 remoteVideosServer1 = res1.body.data.filter(video => video.isLocal === false).map(video => video.uuid)
481 const res2 = await getVideosList(servers[1].url)
482 remoteVideosServer2 = res2.body.data.filter(video => video.isLocal === false).map(video => video.uuid)
484 const res3 = await getVideosList(servers[2].url)
485 localVideosServer3 = res3.body.data.filter(video => video.isLocal === true).map(video => video.uuid)
486 remoteVideosServer3 = res3.body.data.filter(video => video.isLocal === false).map(video => video.uuid)
489 it('Should view multiple videos on owned servers', async function () {
492 const tasks: Promise<any>[] = []
493 tasks.push(viewVideo(servers[2].url, localVideosServer3[0]))
494 tasks.push(viewVideo(servers[2].url, localVideosServer3[0]))
495 tasks.push(viewVideo(servers[2].url, localVideosServer3[0]))
496 tasks.push(viewVideo(servers[2].url, localVideosServer3[1]))
498 await Promise.all(tasks)
502 for (const server of servers) {
503 const res = await getVideosList(server.url)
505 const videos = res.body.data
506 const video0 = videos.find(v => v.uuid === localVideosServer3[0])
507 const video1 = videos.find(v => v.uuid === localVideosServer3[1])
509 expect(video0.views).to.equal(3)
510 expect(video1.views).to.equal(1)
514 it('Should view multiple videos on each servers', async function () {
517 const tasks: Promise<any>[] = []
518 tasks.push(viewVideo(servers[0].url, remoteVideosServer1[0]))
519 tasks.push(viewVideo(servers[1].url, remoteVideosServer2[0]))
520 tasks.push(viewVideo(servers[1].url, remoteVideosServer2[0]))
521 tasks.push(viewVideo(servers[2].url, remoteVideosServer3[0]))
522 tasks.push(viewVideo(servers[2].url, remoteVideosServer3[1]))
523 tasks.push(viewVideo(servers[2].url, remoteVideosServer3[1]))
524 tasks.push(viewVideo(servers[2].url, remoteVideosServer3[1]))
525 tasks.push(viewVideo(servers[2].url, localVideosServer3[1]))
526 tasks.push(viewVideo(servers[2].url, localVideosServer3[1]))
527 tasks.push(viewVideo(servers[2].url, localVideosServer3[1]))
529 await Promise.all(tasks)
533 let baseVideos = null
535 for (const server of servers) {
536 const res = await getVideosList(server.url)
538 const videos = res.body.data
540 // Initialize base videos for future comparisons
541 if (baseVideos === null) {
546 for (const baseVideo of baseVideos) {
547 const sameVideo = videos.find(video => video.name === baseVideo.name)
548 expect(baseVideo.views).to.equal(sameVideo.views)
553 it('Should like and dislikes videos on different services', async function () {
556 const tasks: Promise<any>[] = []
557 tasks.push(rateVideo(servers[0].url, servers[0].accessToken, remoteVideosServer1[0], 'like'))
558 tasks.push(rateVideo(servers[0].url, servers[0].accessToken, remoteVideosServer1[0], 'dislike'))
559 tasks.push(rateVideo(servers[0].url, servers[0].accessToken, remoteVideosServer1[0], 'like'))
560 tasks.push(rateVideo(servers[2].url, servers[2].accessToken, localVideosServer3[1], 'like'))
561 tasks.push(rateVideo(servers[2].url, servers[2].accessToken, localVideosServer3[1], 'dislike'))
562 tasks.push(rateVideo(servers[2].url, servers[2].accessToken, remoteVideosServer3[1], 'dislike'))
563 tasks.push(rateVideo(servers[2].url, servers[2].accessToken, remoteVideosServer3[0], 'like'))
565 await Promise.all(tasks)
569 let baseVideos = null
570 for (const server of servers) {
571 const res = await getVideosList(server.url)
573 const videos = res.body.data
575 // Initialize base videos for future comparisons
576 if (baseVideos === null) {
581 for (const baseVideo of baseVideos) {
582 const sameVideo = videos.find(video => video.name === baseVideo.name)
583 expect(baseVideo.likes).to.equal(sameVideo.likes)
584 expect(baseVideo.dislikes).to.equal(sameVideo.dislikes)
590 describe('Should manipulate these videos', function () {
591 it('Should update the video 3 by asking server 3', async function () {
595 name: 'my super video updated',
600 description: 'my super description updated',
601 tags: [ 'tag_up_1', 'tag_up_2' ]
604 await updateVideo(servers[2].url, servers[2].accessToken, toRemove[0].id, attributes)
609 it('Should have the video 3 updated on each server', async function () {
612 for (const server of servers) {
613 const res = await getVideosList(server.url)
615 const videos = res.body.data
616 const videoUpdated = videos.find(video => video.name === 'my super video updated')
618 expect(!!videoUpdated).to.be.true
619 expect(videoUpdated.category).to.equal(10)
620 expect(videoUpdated.categoryLabel).to.equal('Entertainment')
621 expect(videoUpdated.licence).to.equal(7)
622 expect(videoUpdated.licenceLabel).to.equal('Public Domain Dedication')
623 expect(videoUpdated.language).to.equal(13)
624 expect(videoUpdated.languageLabel).to.equal('French')
625 expect(videoUpdated.nsfw).to.be.ok
626 expect(videoUpdated.description).to.equal('my super description updated')
627 expect(videoUpdated.tags).to.deep.equal([ 'tag_up_1', 'tag_up_2' ])
628 expect(dateIsValid(videoUpdated.updatedAt, 20000)).to.be.true
630 const res2 = await getVideo(server.url, videoUpdated.uuid)
631 const videoUpdatedDetails = res2.body
633 const file = videoUpdatedDetails .files[0]
634 expect(file.magnetUri).to.have.lengthOf.above(2)
635 expect(file.resolution).to.equal(720)
636 expect(file.resolutionLabel).to.equal('720p')
637 expect(file.size).to.equal(292677)
639 const test = await testVideoImage(server.url, 'video_short3.webm', videoUpdated.thumbnailPath)
640 expect(test).to.equal(true)
642 // Avoid "duplicate torrent" errors
643 const refreshWebTorrent = true
644 const torrent = await webtorrentAdd(videoUpdatedDetails .files[0].magnetUri, refreshWebTorrent)
645 expect(torrent.files).to.be.an('array')
646 expect(torrent.files.length).to.equal(1)
647 expect(torrent.files[0].path).to.exist.and.to.not.equal('')
651 it('Should remove the videos 3 and 3-2 by asking server 3', async function () {
654 await removeVideo(servers[2].url, servers[2].accessToken, toRemove[0].id)
655 await removeVideo(servers[2].url, servers[2].accessToken, toRemove[1].id)
660 it('Should have videos 1 and 3 on each server', async function () {
661 for (const server of servers) {
662 const res = await getVideosList(server.url)
664 const videos = res.body.data
665 expect(videos).to.be.an('array')
666 expect(videos.length).to.equal(2)
667 expect(videos[0].name).not.to.equal(videos[1].name)
668 expect(videos[0].name).not.to.equal(toRemove[0].name)
669 expect(videos[1].name).not.to.equal(toRemove[0].name)
670 expect(videos[0].name).not.to.equal(toRemove[1].name)
671 expect(videos[1].name).not.to.equal(toRemove[1].name)
673 videoUUID = videos.find(video => video.name === 'my super name for server 1').uuid
677 it('Should get the same video by UUID on each server', async function () {
679 for (const server of servers) {
680 const res = await getVideo(server.url, videoUUID)
682 const video = res.body
684 if (baseVideo === null) {
689 expect(baseVideo.name).to.equal(video.name)
690 expect(baseVideo.uuid).to.equal(video.uuid)
691 expect(baseVideo.category).to.equal(video.category)
692 expect(baseVideo.language).to.equal(video.language)
693 expect(baseVideo.licence).to.equal(video.licence)
694 expect(baseVideo.category).to.equal(video.category)
695 expect(baseVideo.nsfw).to.equal(video.nsfw)
696 expect(baseVideo.accountName).to.equal(video.accountName)
697 expect(baseVideo.tags).to.deep.equal(video.tags)
701 it('Should get the preview from each server', async function () {
702 for (const server of servers) {
703 const res = await getVideo(server.url, videoUUID)
704 const video = res.body
706 const test = await testVideoImage(server.url, 'video_short1-preview.webm', video.previewPath)
707 expect(test).to.equal(true)
712 describe('With minimum parameters', function () {
713 it('Should upload and propagate the video', async function () {
716 const path = '/api/v1/videos/upload'
718 const req = request(servers[1].url)
720 .set('Accept', 'application/json')
721 .set('Authorization', 'Bearer ' + servers[1].accessToken)
722 .field('name', 'minimum parameters')
723 .field('privacy', '1')
724 .field('nsfw', 'false')
725 .field('channelId', '1')
727 const filePath = join(__dirname, '..', 'api', 'fixtures', 'video_short.webm')
729 await req.attach('videofile', filePath)
734 for (const server of servers) {
735 const res = await getVideosList(server.url)
736 const video = res.body.data.find(v => v.name === 'minimum parameters')
738 expect(video.name).to.equal('minimum parameters')
739 expect(video.category).to.equal(null)
740 expect(video.categoryLabel).to.equal('Misc')
741 expect(video.licence).to.equal(null)
742 expect(video.licenceLabel).to.equal('Unknown')
743 expect(video.language).to.equal(null)
744 expect(video.languageLabel).to.equal('Unknown')
745 expect(video.nsfw).to.not.be.ok
746 expect(video.description).to.equal(null)
747 expect(video.serverHost).to.equal('localhost:9002')
748 expect(video.accountName).to.equal('root')
749 expect(video.tags).to.deep.equal([ ])
750 expect(dateIsValid(video.createdAt)).to.be.true
751 expect(dateIsValid(video.updatedAt)).to.be.true
756 after(async function () {
757 killallServers(servers)
759 // Keep the logs if the test failed