1 import * as chai from 'chai'
2 import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
4 const expect = chai.expect
6 describe('Test video source', () => {
7 let server: PeerTubeServer = null
8 const fixture = 'video_short.webm'
10 before(async function () {
13 server = await createSingleServer(1)
14 await setAccessTokensToServers([ server ])
17 it('Should get the source filename with legacy upload', async function () {
20 const { uuid } = await server.videos.upload({ attributes: { name: 'my video', fixture }, mode: 'legacy' })
22 const source = await server.videos.getSource({ id: uuid })
23 expect(source.filename).to.equal(fixture)
26 it('Should get the source filename with resumable upload', async function () {
29 const { uuid } = await server.videos.upload({ attributes: { name: 'my video', fixture }, mode: 'resumable' })
31 const source = await server.videos.getSource({ id: uuid })
32 expect(source.filename).to.equal(fixture)
35 after(async function () {
36 await cleanupTests([ server ])