aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli/peertube.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:04:35 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit89d241a79c262b9775c233b73cff080043ebb5e6 (patch)
treecb3b6cb431d25d891ef4e02f66c61d252d17048f /server/tests/cli/peertube.ts
parentd23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff)
downloadPeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip
Shorter server command names
Diffstat (limited to 'server/tests/cli/peertube.ts')
-rw-r--r--server/tests/cli/peertube.ts28
1 files changed, 14 insertions, 14 deletions
diff --git a/server/tests/cli/peertube.ts b/server/tests/cli/peertube.ts
index fe5f63191..a83aa7724 100644
--- a/server/tests/cli/peertube.ts
+++ b/server/tests/cli/peertube.ts
@@ -30,16 +30,16 @@ describe('Test CLI wrapper', function () {
30 server = await flushAndRunServer(1) 30 server = await flushAndRunServer(1)
31 await setAccessTokensToServers([ server ]) 31 await setAccessTokensToServers([ server ])
32 32
33 await server.usersCommand.create({ username: 'user_1', password: 'super_password' }) 33 await server.users.create({ username: 'user_1', password: 'super_password' })
34 34
35 userAccessToken = await server.loginCommand.getAccessToken({ username: 'user_1', password: 'super_password' }) 35 userAccessToken = await server.login.getAccessToken({ username: 'user_1', password: 'super_password' })
36 36
37 { 37 {
38 const attributes = { name: 'user_channel', displayName: 'User channel', support: 'super support text' } 38 const attributes = { name: 'user_channel', displayName: 'User channel', support: 'super support text' }
39 await server.channelsCommand.create({ token: userAccessToken, attributes }) 39 await server.channels.create({ token: userAccessToken, attributes })
40 } 40 }
41 41
42 cliCommand = server.cliCommand 42 cliCommand = server.cli
43 }) 43 })
44 44
45 describe('Authentication and instance selection', function () { 45 describe('Authentication and instance selection', function () {
@@ -48,7 +48,7 @@ describe('Test CLI wrapper', function () {
48 const stdout = await cliCommand.execWithEnv(`${cmd} token --url ${server.url} --username user_1 --password super_password`) 48 const stdout = await cliCommand.execWithEnv(`${cmd} token --url ${server.url} --username user_1 --password super_password`)
49 const token = stdout.trim() 49 const token = stdout.trim()
50 50
51 const body = await server.usersCommand.getMyInfo({ token }) 51 const body = await server.users.getMyInfo({ token })
52 expect(body.username).to.equal('user_1') 52 expect(body.username).to.equal('user_1')
53 }) 53 })
54 54
@@ -103,10 +103,10 @@ describe('Test CLI wrapper', function () {
103 }) 103 })
104 104
105 it('Should have the video uploaded', async function () { 105 it('Should have the video uploaded', async function () {
106 const { total, data } = await server.videosCommand.list() 106 const { total, data } = await server.videos.list()
107 expect(total).to.equal(1) 107 expect(total).to.equal(1)
108 108
109 const video = await server.videosCommand.get({ id: data[0].uuid }) 109 const video = await server.videos.get({ id: data[0].uuid })
110 expect(video.name).to.equal('test upload') 110 expect(video.name).to.equal('test upload')
111 expect(video.support).to.equal('support_text') 111 expect(video.support).to.equal('support_text')
112 expect(video.channel.name).to.equal('user_channel') 112 expect(video.channel.name).to.equal('user_channel')
@@ -128,19 +128,19 @@ describe('Test CLI wrapper', function () {
128 128
129 await waitJobs([ server ]) 129 await waitJobs([ server ])
130 130
131 const { total, data } = await server.videosCommand.list() 131 const { total, data } = await server.videos.list()
132 expect(total).to.equal(2) 132 expect(total).to.equal(2)
133 133
134 const video = data.find(v => v.name === 'small video - youtube') 134 const video = data.find(v => v.name === 'small video - youtube')
135 expect(video).to.not.be.undefined 135 expect(video).to.not.be.undefined
136 136
137 const videoDetails = await server.videosCommand.get({ id: video.id }) 137 const videoDetails = await server.videos.get({ id: video.id })
138 expect(videoDetails.channel.name).to.equal('user_channel') 138 expect(videoDetails.channel.name).to.equal('user_channel')
139 expect(videoDetails.support).to.equal('super support text') 139 expect(videoDetails.support).to.equal('super support text')
140 expect(videoDetails.nsfw).to.be.false 140 expect(videoDetails.nsfw).to.be.false
141 141
142 // So we can reimport it 142 // So we can reimport it
143 await server.videosCommand.remove({ token: userAccessToken, id: video.id }) 143 await server.videos.remove({ token: userAccessToken, id: video.id })
144 }) 144 })
145 145
146 it('Should import and override some imported attributes', async function () { 146 it('Should import and override some imported attributes', async function () {
@@ -155,13 +155,13 @@ describe('Test CLI wrapper', function () {
155 await waitJobs([ server ]) 155 await waitJobs([ server ])
156 156
157 { 157 {
158 const { total, data } = await server.videosCommand.list() 158 const { total, data } = await server.videos.list()
159 expect(total).to.equal(2) 159 expect(total).to.equal(2)
160 160
161 const video = data.find(v => v.name === 'toto') 161 const video = data.find(v => v.name === 'toto')
162 expect(video).to.not.be.undefined 162 expect(video).to.not.be.undefined
163 163
164 const videoDetails = await server.videosCommand.get({ id: video.id }) 164 const videoDetails = await server.videos.get({ id: video.id })
165 expect(videoDetails.channel.name).to.equal('user_channel') 165 expect(videoDetails.channel.name).to.equal('user_channel')
166 expect(videoDetails.support).to.equal('support') 166 expect(videoDetails.support).to.equal('support')
167 expect(videoDetails.nsfw).to.be.true 167 expect(videoDetails.nsfw).to.be.true
@@ -225,10 +225,10 @@ describe('Test CLI wrapper', function () {
225 servers = [ server, anotherServer ] 225 servers = [ server, anotherServer ]
226 await waitJobs(servers) 226 await waitJobs(servers)
227 227
228 const { uuid } = await anotherServer.videosCommand.quickUpload({ name: 'super video' }) 228 const { uuid } = await anotherServer.videos.quickUpload({ name: 'super video' })
229 await waitJobs(servers) 229 await waitJobs(servers)
230 230
231 video1Server2 = await server.videosCommand.getId({ uuid }) 231 video1Server2 = await server.videos.getId({ uuid })
232 }) 232 })
233 233
234 it('Should add a redundancy', async function () { 234 it('Should add a redundancy', async function () {