X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Ftests%2Fcli%2Fprune-storage.ts;h=d4dbee682e00d64b08073ce33bd82711c82f3da4;hb=9293139fde7091e9badcafa9b570b83cea9a10ad;hp=81f91105c72e3f0c9383fcd52f40378fae015d25;hpb=329619b3453479f76c049816b7403b86e9d45cb5;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/cli/prune-storage.ts b/server/tests/cli/prune-storage.ts index 81f91105c..d4dbee682 100644 --- a/server/tests/cli/prune-storage.ts +++ b/server/tests/cli/prune-storage.ts @@ -5,15 +5,13 @@ import * as chai from 'chai' import { createFile, readdir } from 'fs-extra' import { join } from 'path' import { buildUUID } from '@server/helpers/uuid' -import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '@shared/core-utils' import { buildServerDirectory, cleanupTests, CLICommand, - createVideoPlaylist, doubleFollow, flushAndRunMultipleServers, - getAccount, killallServers, makeGetRequest, ServerInfo, @@ -21,10 +19,10 @@ import { setDefaultVideoChannel, updateMyAvatar, uploadVideo, - wait -} from '../../../shared/extra-utils' -import { waitJobs } from '../../../shared/extra-utils/server/jobs' -import { Account, VideoPlaylistPrivacy } from '../../../shared/models' + wait, + waitJobs +} from '@shared/extra-utils' +import { VideoPlaylistPrivacy } from '@shared/models' const expect = chai.expect @@ -78,10 +76,8 @@ describe('Test prune storage scripts', function () { await updateMyAvatar({ url: server.url, accessToken: server.accessToken, fixture: 'avatar.png' }) - await createVideoPlaylist({ - url: server.url, - token: server.accessToken, - playlistAttrs: { + await server.playlistsCommand.create({ + attributes: { displayName: 'playlist', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: server.videoChannel.id, @@ -94,8 +90,7 @@ describe('Test prune storage scripts', function () { // Lazy load the remote avatar { - const res = await getAccount(servers[0].url, 'root@localhost:' + servers[1].port) - const account: Account = res.body + const account = await servers[0].accountsCommand.get({ accountName: 'root@localhost:' + servers[1].port }) await makeGetRequest({ url: servers[0].url, path: account.avatar.path, @@ -104,8 +99,7 @@ describe('Test prune storage scripts', function () { } { - const res = await getAccount(servers[1].url, 'root@localhost:' + servers[0].port) - const account: Account = res.body + const account = await servers[1].accountsCommand.get({ accountName: 'root@localhost:' + servers[0].port }) await makeGetRequest({ url: servers[1].url, path: account.avatar.path, @@ -116,7 +110,7 @@ describe('Test prune storage scripts', function () { await wait(1000) await waitJobs(servers) - killallServers(servers) + await killallServers(servers) await wait(1000) })