aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/real-world/real-world.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/real-world/real-world.js')
-rw-r--r--server/tests/real-world/real-world.js25
1 files changed, 14 insertions, 11 deletions
diff --git a/server/tests/real-world/real-world.js b/server/tests/real-world/real-world.js
index f17c83f85..32afeec68 100644
--- a/server/tests/real-world/real-world.js
+++ b/server/tests/real-world/real-world.js
@@ -200,15 +200,16 @@ function exitServers (servers, callback) {
200function upload (servers, numServer, callback) { 200function upload (servers, numServer, callback) {
201 if (!callback) callback = function () {} 201 if (!callback) callback = function () {}
202 202
203 const name = Date.now() + ' name'
204 const category = 4
205 const description = Date.now() + ' description'
206 const tags = [ Date.now().toString().substring(0, 5) + 't1', Date.now().toString().substring(0, 5) + 't2' ]
207 const file = 'video_short1.webm'
208
209 console.log('Uploading video to server ' + numServer) 203 console.log('Uploading video to server ' + numServer)
210 204
211 videosUtils.uploadVideo(servers[numServer].url, servers[numServer].accessToken, name, category, description, tags, file, callback) 205 const videoAttributes = {
206 name: Date.now() + ' name',
207 category: 4,
208 description: Date.now() + ' description',
209 tags: [ Date.now().toString().substring(0, 5) + 't1', Date.now().toString().substring(0, 5) + 't2' ],
210 fixture: 'video_short1.webm'
211 }
212 videosUtils.uploadVideo(servers[numServer].url, servers[numServer].accessToken, videoAttributes, callback)
212} 213}
213 214
214function update (servers, numServer, callback) { 215function update (servers, numServer, callback) {
@@ -221,13 +222,15 @@ function update (servers, numServer, callback) {
221 if (videos.length === 0) return callback() 222 if (videos.length === 0) return callback()
222 223
223 const toUpdate = videos[getRandomInt(0, videos.length)].id 224 const toUpdate = videos[getRandomInt(0, videos.length)].id
224 const name = Date.now() + ' name' 225 const attributes = {
225 const description = Date.now() + ' description' 226 name: Date.now() + ' name',
226 const tags = [ Date.now().toString().substring(0, 5) + 't1', Date.now().toString().substring(0, 5) + 't2' ] 227 description: Date.now() + ' description',
228 tags: [ Date.now().toString().substring(0, 5) + 't1', Date.now().toString().substring(0, 5) + 't2' ]
229 }
227 230
228 console.log('Updating video of server ' + numServer) 231 console.log('Updating video of server ' + numServer)
229 232
230 videosUtils.updateVideo(servers[numServer].url, servers[numServer].accessToken, toUpdate, name, description, tags, callback) 233 videosUtils.updateVideo(servers[numServer].url, servers[numServer].accessToken, toUpdate, attributes, callback)
231 }) 234 })
232} 235}
233 236