aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/live/live-constraints.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/api/live/live-constraints.ts
parentd23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff)
downloadPeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip
Shorter server command names
Diffstat (limited to 'server/tests/api/live/live-constraints.ts')
-rw-r--r--server/tests/api/live/live-constraints.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/server/tests/api/live/live-constraints.ts b/server/tests/api/live/live-constraints.ts
index 7900b1abe..1c380883c 100644
--- a/server/tests/api/live/live-constraints.ts
+++ b/server/tests/api/live/live-constraints.ts
@@ -32,13 +32,13 @@ describe('Test live constraints', function () {
32 saveReplay 32 saveReplay
33 } 33 }
34 34
35 const { uuid } = await servers[0].liveCommand.create({ token: userAccessToken, fields: liveAttributes }) 35 const { uuid } = await servers[0].live.create({ token: userAccessToken, fields: liveAttributes })
36 return uuid 36 return uuid
37 } 37 }
38 38
39 async function checkSaveReplay (videoId: string, resolutions = [ 720 ]) { 39 async function checkSaveReplay (videoId: string, resolutions = [ 720 ]) {
40 for (const server of servers) { 40 for (const server of servers) {
41 const video = await server.videosCommand.get({ id: videoId }) 41 const video = await server.videos.get({ id: videoId })
42 expect(video.isLive).to.be.false 42 expect(video.isLive).to.be.false
43 expect(video.duration).to.be.greaterThan(0) 43 expect(video.duration).to.be.greaterThan(0)
44 } 44 }
@@ -48,12 +48,12 @@ describe('Test live constraints', function () {
48 48
49 async function waitUntilLivePublishedOnAllServers (videoId: string) { 49 async function waitUntilLivePublishedOnAllServers (videoId: string) {
50 for (const server of servers) { 50 for (const server of servers) {
51 await server.liveCommand.waitUntilPublished({ videoId }) 51 await server.live.waitUntilPublished({ videoId })
52 } 52 }
53 } 53 }
54 54
55 function updateQuota (options: { total: number, daily: number }) { 55 function updateQuota (options: { total: number, daily: number }) {
56 return servers[0].usersCommand.update({ 56 return servers[0].users.update({
57 userId, 57 userId,
58 videoQuota: options.total, 58 videoQuota: options.total,
59 videoQuotaDaily: options.daily 59 videoQuotaDaily: options.daily
@@ -69,7 +69,7 @@ describe('Test live constraints', function () {
69 await setAccessTokensToServers(servers) 69 await setAccessTokensToServers(servers)
70 await setDefaultVideoChannel(servers) 70 await setDefaultVideoChannel(servers)
71 71
72 await servers[0].configCommand.updateCustomSubConfig({ 72 await servers[0].config.updateCustomSubConfig({
73 newConfig: { 73 newConfig: {
74 live: { 74 live: {
75 enabled: true, 75 enabled: true,
@@ -82,7 +82,7 @@ describe('Test live constraints', function () {
82 }) 82 })
83 83
84 { 84 {
85 const res = await servers[0].usersCommand.generate('user1') 85 const res = await servers[0].users.generate('user1')
86 userId = res.userId 86 userId = res.userId
87 userChannelId = res.userChannelId 87 userChannelId = res.userChannelId
88 userAccessToken = res.token 88 userAccessToken = res.token
@@ -98,7 +98,7 @@ describe('Test live constraints', function () {
98 this.timeout(60000) 98 this.timeout(60000)
99 99
100 const userVideoLiveoId = await createLiveWrapper(false) 100 const userVideoLiveoId = await createLiveWrapper(false)
101 await servers[0].liveCommand.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: false }) 101 await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: false })
102 }) 102 })
103 103
104 it('Should have size limit depending on user global quota if save replay is enabled', async function () { 104 it('Should have size limit depending on user global quota if save replay is enabled', async function () {
@@ -108,7 +108,7 @@ describe('Test live constraints', function () {
108 await wait(5000) 108 await wait(5000)
109 109
110 const userVideoLiveoId = await createLiveWrapper(true) 110 const userVideoLiveoId = await createLiveWrapper(true)
111 await servers[0].liveCommand.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true }) 111 await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
112 112
113 await waitUntilLivePublishedOnAllServers(userVideoLiveoId) 113 await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
114 await waitJobs(servers) 114 await waitJobs(servers)
@@ -125,7 +125,7 @@ describe('Test live constraints', function () {
125 await updateQuota({ total: -1, daily: 1 }) 125 await updateQuota({ total: -1, daily: 1 })
126 126
127 const userVideoLiveoId = await createLiveWrapper(true) 127 const userVideoLiveoId = await createLiveWrapper(true)
128 await servers[0].liveCommand.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true }) 128 await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
129 129
130 await waitUntilLivePublishedOnAllServers(userVideoLiveoId) 130 await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
131 await waitJobs(servers) 131 await waitJobs(servers)
@@ -142,13 +142,13 @@ describe('Test live constraints', function () {
142 await updateQuota({ total: 10 * 1000 * 1000, daily: -1 }) 142 await updateQuota({ total: 10 * 1000 * 1000, daily: -1 })
143 143
144 const userVideoLiveoId = await createLiveWrapper(true) 144 const userVideoLiveoId = await createLiveWrapper(true)
145 await servers[0].liveCommand.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: false }) 145 await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: false })
146 }) 146 })
147 147
148 it('Should have max duration limit', async function () { 148 it('Should have max duration limit', async function () {
149 this.timeout(60000) 149 this.timeout(60000)
150 150
151 await servers[0].configCommand.updateCustomSubConfig({ 151 await servers[0].config.updateCustomSubConfig({
152 newConfig: { 152 newConfig: {
153 live: { 153 live: {
154 enabled: true, 154 enabled: true,
@@ -163,7 +163,7 @@ describe('Test live constraints', function () {
163 }) 163 })
164 164
165 const userVideoLiveoId = await createLiveWrapper(true) 165 const userVideoLiveoId = await createLiveWrapper(true)
166 await servers[0].liveCommand.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true }) 166 await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
167 167
168 await waitUntilLivePublishedOnAllServers(userVideoLiveoId) 168 await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
169 await waitJobs(servers) 169 await waitJobs(servers)