getMyUserInformation,
getMyVideos,
getVideosList,
+ ImportsCommand,
killallServers,
reRunServer,
ServerInfo,
setAccessTokensToServers,
updateVideo,
uploadVideo,
- userLogin,
waitJobs
} from '@shared/extra-utils'
-import { getGoodVideoUrl, getMagnetURI, importVideo } from '@shared/extra-utils/videos/video-imports'
import { User, UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models'
const expect = chai.expect
before(async function () {
this.timeout(20000)
- killallServers([ servers[0] ])
+ await killallServers([ servers[0] ])
const config = {
auto_blacklist: {
role: UserRole.USER
})
- userWithoutFlag = await userLogin(servers[0], user)
+ userWithoutFlag = await servers[0].loginCommand.getAccessToken(user)
const res = await getMyUserInformation(servers[0].url, userWithoutFlag)
const body: User = res.body
role: UserRole.USER
})
- userWithFlag = await userLogin(servers[0], user)
+ userWithFlag = await servers[0].loginCommand.getAccessToken(user)
}
await waitJobs(servers)
this.timeout(15000)
const attributes = {
- targetUrl: getGoodVideoUrl(),
+ targetUrl: ImportsCommand.getGoodVideoUrl(),
name: 'URL import',
channelId: channelOfUserWithoutFlag
}
- await importVideo(servers[0].url, userWithoutFlag, attributes)
+ await servers[0].importsCommand.importVideo({ token: userWithoutFlag, attributes })
const body = await command.list({ sort: 'createdAt', type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED })
expect(body.total).to.equal(2)
it('Should auto blacklist a video on torrent import', async function () {
const attributes = {
- magnetUri: getMagnetURI(),
+ magnetUri: ImportsCommand.getMagnetURI(),
name: 'Torrent import',
channelId: channelOfUserWithoutFlag
}
- await importVideo(servers[0].url, userWithoutFlag, attributes)
+ await servers[0].importsCommand.importVideo({ token: userWithoutFlag, attributes })
const body = await command.list({ sort: 'createdAt', type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED })
expect(body.total).to.equal(3)