Fix tests

pull/6562/head
Chocobozzz 2024-08-13 14:51:30 +02:00
parent fab70099b1
commit 3a2e457320
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 26 additions and 3 deletions

View File

@ -84,6 +84,20 @@ describe('Test proxy', function () {
describe('Videos import', async function () {
function getProxyConfig (url: string) {
return {
import: {
videos: {
http: {
proxies: url
? [ url ]
: []
}
}
}
}
}
function quickImport (expectedStatus: HttpStatusCodeType = HttpStatusCode.OK_200) {
return servers[0].videoImports.importVideo({
attributes: {
@ -100,7 +114,7 @@ describe('Test proxy', function () {
this.timeout(240000)
await servers[0].kill()
await servers[0].run({}, { env: goodEnv })
await servers[0].run(getProxyConfig(null), { env: goodEnv })
await quickImport()
@ -111,11 +125,20 @@ describe('Test proxy', function () {
expect(data).to.have.lengthOf(3)
})
it('Should fail import with a wrong proxy config', async function () {
it('Should fail import with a wrong proxy config in env', async function () {
this.timeout(120000)
await servers[0].kill()
await servers[0].run({}, { env: badEnv })
await servers[0].run(getProxyConfig(null), { env: badEnv })
await quickImport(HttpStatusCode.BAD_REQUEST_400)
})
it('Should fail import with a wrong proxy config in config', async function () {
this.timeout(120000)
await servers[0].kill()
await servers[0].run(getProxyConfig('http://localhost:9000'))
await quickImport(HttpStatusCode.BAD_REQUEST_400)
})