From 9e5f374090ea0fb16f93edd79d5ad61a55db91e5 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 10 May 2016 21:55:59 +0200 Subject: [PATCH] Add tests for thumbnails --- server/tests/api/fixtures/video_short.mp4.jpg | Bin 0 -> 2618 bytes server/tests/api/fixtures/video_short.ogv.jpg | Bin 0 -> 2618 bytes .../tests/api/fixtures/video_short.webm.jpg | Bin 0 -> 2615 bytes .../tests/api/fixtures/video_short1.webm.jpg | Bin 0 -> 2901 bytes .../tests/api/fixtures/video_short2.webm.jpg | Bin 0 -> 3185 bytes .../tests/api/fixtures/video_short3.webm.jpg | Bin 0 -> 2886 bytes server/tests/api/multiplePods.js | 26 +++++++- server/tests/api/singlePod.js | 57 ++++++++++++++---- server/tests/api/utils.js | 17 ++++++ 9 files changed, 85 insertions(+), 15 deletions(-) create mode 100644 server/tests/api/fixtures/video_short.mp4.jpg create mode 100644 server/tests/api/fixtures/video_short.ogv.jpg create mode 100644 server/tests/api/fixtures/video_short.webm.jpg create mode 100644 server/tests/api/fixtures/video_short1.webm.jpg create mode 100644 server/tests/api/fixtures/video_short2.webm.jpg create mode 100644 server/tests/api/fixtures/video_short3.webm.jpg diff --git a/server/tests/api/fixtures/video_short.mp4.jpg b/server/tests/api/fixtures/video_short.mp4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..48790ffecd4236573170e47daf0bab5c28d6d593 GIT binary patch literal 2618 zcmbu9cTm%58pnSr^gs$p1VLE|A`n1IfUI<+8bE@DA|MDTC>;q+7ZGV$PzXgLQ51ul}0>2GZ3;-Y@(02iU7YGc23JJ!FiA#V0$d61= zf298qA^ zIwm$Q=|XZ!YFav#mXn*8f4P8urTAtE^VaRsJ7rZ5s@XNQ4>@%$t!?d3Iy#?r^$)yw zIXE;tGCDE&ZfbgF_P4qD)wT8aAO6_bAPs|98yi{}S|{%zq;Dn*gLJ5CU{U zK#Bku2|$nle-wa0K!S^)HwD(VsuZ6S|F>oto0>m*@s<`JWoLQ1} z??~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&&b^6%t z?2bcvLI9d<^`Cu%9)~hXMdvy}KF<+(Z!Q*Tzx%+7DIS=H9b)f-{JfTf%jcOBLnjsn zvhdh?ICwMFq5pV%JkO{kyP;_r8rdQWfcv_*atH%J?$d}o73kLQRTkGQjjX3^zS4ZN z8-KM7{;^3nX~R0u61%TzDam<^SsfRpro8H%LCMfna$K<-r9)8Wf%(=>l_=# ztn7AuW}hexrym5!a)6(B#cR`krdwx9_|#hiM1{%mnUOOSGk$Afg4dJxMm{;pq*)|d zje2~(aJS1Mxp|zsZA4=|?1qhF++c9<=Iu7@Yo*6W>H}sovFKl=%gRFz`!eua9X$)K OxiFPtD)3j#ANd>f8)}3A literal 0 HcmV?d00001 diff --git a/server/tests/api/fixtures/video_short.ogv.jpg b/server/tests/api/fixtures/video_short.ogv.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c4c1d00e53239243774ccd1d7c38aec069424f37 GIT binary patch literal 2618 zcmbu7dom(zGZ}@HN--*IcC)8CYp=c5IcuGB_W7>$dEVz;&sxv>`QsH$h+Y7)_SSaR z00;~yHYiL2faohA`&Yk+025OK64}7WkOYYMz+M0eha=z!Zue$2%6 z$Mg?FSpW=zK)_H43HUfYNYS8(=2=+G5O=h=lw%%18lC70nvtg$~M zPC`<7lZvXE?p8gVKAvo{!_>@t=iYr*);6|w_6J?v4!L`HdIbaq9SuGfay;xzctj-g zY}AGLgv6wamy$CwIa%44b8@c~72hbiS^AG#w`*$a>KhuHnp^I5-+$24+xM{l$;jx~ z_|u7JyqD86v#;h}znOo#BwYUV`OC`c+AnfqWiS*9fg-*sgTRquAaYQcwh>&O>WuKC zE9j8UBNg|s3#+>%Fvc#6O8$&tNo6egrS8%<>+jP4opaoulK$QKcV$s0Acq7_0eujV z4gi(|Aaa0+2cRGz@kQKQ076MzQS85`e3yk~$LNcU=}G6})T2iSV-02T#xde;StU>CPM;)REVj#-KbkezqwdYNxOr+9^&Qrz=IpM+a;)u)_Oae`YZ zg}FZY@aaTpU8`m078h4T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RtLt>stG?Axqe%>3S=7eU%M_6lC7rLCc(&aii_m3a z)+(gx!Y3u`%$rOukq7Q=e;9t35mMX`-1lyy&m*YE1)ahib=JUTX{)|E(a3qO2liNH z=uA{SFh6KploiD@^#rC<^`Usl* z=IX2{L3tl-e;lT!O4P3+L-xJh+IabL*XpZFC59m0E0dSiFF%ju-50d$4(^-tOgKz~ z4~HAaNAU+|Xvaq)%%>k;>Zr3?{)p~tHN0A%#%)Dv^iYZIhvYbv=*+x)*zwkFP+n!8s%3BJ(nwcNc?Jfqp>|eH7cVNt z*)cooNxP&dk&&<69cg9Hh=rp@eNBmRj3&mR2c<1?5Nl|q3Amu}x7E+|LcgUGmnL-l z9p1K&vZ`3~t1puBc4brsRhJ(Tp<{|-|M`DXNy7V9Dl%>aYN@@U+8a%`iztQO#LIXF zz?U?QB;^6J_5bGMscSgv7({qeLxx-Yczu`3*9CI7m`c1P5a{q2&uG4!loVRn&8)F@ z?Y66zW`nio{*p-tJzd=%V6A&s$<0#TpxRxlE|9>K(L}%lJHw_DTj!<~ z3%JFmlLz{X{P+1>W~w$y-t}O744sKEQnT-kt?Pr~20Juvf`?@Guh*_Uu`U>T%4~bm zqV1)d7pkne;!f~aI{>k3VJ$6}nXGHTu zrM=0hty1r>dq)zl!H0PX&CHLFgtzy9T4$s2PjEW~>ntv5jYTNPaWzI!Y*X z`Gl94P~A&RVU+dUAh+t?}1D6o&gx}o?*g0OjTAVe|XZbI>?Lq z9K7)yF}B`wpA1cO4z?(edxL-UOr6a)4^yAo1j5Smkb@ly($r@Dwi|HSe8v9=vQtL@|U?q-UA=#;TFCVq~&T>d`OR*ZK>H)*0i^2!wW?CXjv?w M;SavH^ya(20WV03S^xk5 literal 0 HcmV?d00001 diff --git a/server/tests/api/fixtures/video_short1.webm.jpg b/server/tests/api/fixtures/video_short1.webm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2db21975c7a6fb2d9320698f7b166866863be86d GIT binary patch literal 2901 zcmbW1do?f z>O{gImq^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%G1!2UEgJ}WD_*V#LBQ{c=P66Kz`4ne7xxC$rB4iqq!sBITUp} zL%PA0E5br7V5f ztf%<_X*9EDA|)HWAsEn5WIjK)ewFt2!;;0K!*E*7$8jWQh&z#a2`-{%whDpo8k^5W zBOBBWy=*&<>zpQtvMK{3hTRXUF-VyO`LWlkWA3}kWTUe&(NA`_O6gm}!WfCof%I)1 zae>`)L!O;i5ga2tPB-R5v&XnboO2ZfJ~!buWb*AtbJ~`8;k@w(x^HG`5OW0Mc+rxf zjmJ2}hKzM7p33*uy>Bqfl@fJEtdD3?c`f~33bn|?Y7FG%Uw!%sV!I9ZEfBj z5}}Dmf2Q)x$GkZ6f@6f^vdZq#rO2LV=h2qQxTW9on??&s(`75)HV8=G)T$+}>Wx#5 zXQ!QVba^oNvbeSBQ)I%!gu94G5qb|JoTo3^QFZ2Tr7CFv;;|)`yd;1USl2DPd-VW0~QQ4Z% zbo!`F4&q&<^@+YKw+j>}Vq&uCFHIa&u&$3=_98D)3;m^My zUs6MnM{teQUrpHHuTL$bTb^Fth$nuhVEWzMOfh>ZXJ{ifdf{Rl_PL{a*!I~%o2i=Z zohcP3seK|GM|-*c!!Kwdp56n$X;4@Evb+{b+Oam*iZImZp|yR4O*nb(UT(wu_BGDO zbJCnqKdvdsN2)=k3u`0ktfWTsrL!yDX%n)z4M~0L#JWR2(-v0FaysIuD;AH_+1TNr zeo|K6Sb&j9zU6AsOr?k{b!nS=Ed8rDhkYlFGa&~7UCZR)hSkGy36sLy&9)+T3v->( zLU(M>V6S#Ex!vj9<6m1^v2!YX0lDWM)yHZY8^T z2m;64isZ8ynhMPUspZjc37&Zl!pbpr%BGaoaykA({1lJKr|nk8kz=E1UcMxRwaKzx ojfvWon5@JsQwNRcpol##n9|a!_=8tFzKBsK9hzrsa8TF301D%ePyhe` literal 0 HcmV?d00001 diff --git a/server/tests/api/fixtures/video_short2.webm.jpg b/server/tests/api/fixtures/video_short2.webm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..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ePods.js b/server/tests/api/multiplePods.js index 4a4532a0f..c19f120ef 100644 --- a/server/tests/api/multiplePods.js +++ b/server/tests/api/multiplePods.js @@ -110,7 +110,12 @@ describe('Test multiple pods', function () { expect(video.magnetUri).to.equal.magnetUri } - callback() + utils.testImage(server.url, 'video_short1.webm', video.thumbnail_path, function (err, test) { + if (err) throw err + expect(test).to.equal(true) + + callback() + }) }) }, done) } @@ -160,7 +165,12 @@ describe('Test multiple pods', function () { expect(video.magnetUri).to.equal.magnetUri } - callback() + utils.testImage(server.url, 'video_short2.webm', video.thumbnail_path, function (err, test) { + if (err) throw err + expect(test).to.equal(true) + + callback() + }) }) }, done) } @@ -231,7 +241,17 @@ describe('Test multiple pods', function () { expect(video2.magnetUri).to.equal.magnetUri } - callback() + utils.testImage(server.url, 'video_short3.webm', video1.thumbnail_path, function (err, test) { + if (err) throw err + expect(test).to.equal(true) + + utils.testImage(server.url, 'video_short.webm', video2.thumbnail_path, function (err, test) { + if (err) throw err + expect(test).to.equal(true) + + callback() + }) + }) }) }, done) } diff --git a/server/tests/api/singlePod.js b/server/tests/api/singlePod.js index e2999530e..9a9af0901 100644 --- a/server/tests/api/singlePod.js +++ b/server/tests/api/singlePod.js @@ -76,14 +76,19 @@ describe('Test a single pod', function () { expect(video.author).to.equal('root') expect(video.isLocal).to.be.true - video_id = video.id + utils.testImage(server.url, 'video_short.webm', video.thumbnail_path, function (err, test) { + if (err) throw err + expect(test).to.equal(true) - webtorrent.add(video.magnetUri, function (torrent) { - expect(torrent.files).to.exist - expect(torrent.files.length).to.equal(1) - expect(torrent.files[0].path).to.exist.and.to.not.equal('') + video_id = video.id - done() + webtorrent.add(video.magnetUri, function (torrent) { + expect(torrent.files).to.exist + expect(torrent.files.length).to.equal(1) + expect(torrent.files[0].path).to.exist.and.to.not.equal('') + + done() + }) }) }) }) @@ -103,12 +108,17 @@ describe('Test a single pod', function () { expect(video.author).to.equal('root') expect(video.isLocal).to.be.true - webtorrent.add(video.magnetUri, function (torrent) { - expect(torrent.files).to.exist - expect(torrent.files.length).to.equal(1) - expect(torrent.files[0].path).to.exist.and.to.not.equal('') + utils.testImage(server.url, 'video_short.webm', video.thumbnail_path, function (err, test) { + if (err) throw err + expect(test).to.equal(true) - done() + webtorrent.add(video.magnetUri, function (torrent) { + expect(torrent.files).to.exist + expect(torrent.files.length).to.equal(1) + expect(torrent.files[0].path).to.exist.and.to.not.equal('') + + done() + }) }) }) }) @@ -127,7 +137,12 @@ describe('Test a single pod', function () { expect(video.author).to.equal('root') expect(video.isLocal).to.be.true - done() + utils.testImage(server.url, 'video_short.webm', video.thumbnail_path, function (err, test) { + if (err) throw err + expect(test).to.equal(true) + + done() + }) }) }) @@ -197,6 +212,24 @@ describe('Test a single pod', function () { }) }) + it('Should have the correct thumbnails', function (done) { + utils.getVideosList(server.url, function (err, res) { + const videos = res.body + + async.each(videos, function (video, callback_each) { + if (err) throw err + const video_name = video.name.replace(' name', '') + + utils.testImage(server.url, video_name, video.thumbnail_path, function (err, test) { + if (err) throw err + + expect(test).to.equal(true) + callback_each() + }) + }, done) + }) + }) + after(function (done) { process.kill(-server.app.pid) process.kill(-webtorrent.app.pid) diff --git a/server/tests/api/utils.js b/server/tests/api/utils.js index c1a01ef37..3d3169fde 100644 --- a/server/tests/api/utils.js +++ b/server/tests/api/utils.js @@ -3,6 +3,7 @@ const child_process = require('child_process') const exec = child_process.exec const fork = child_process.fork +const fs = require('fs') const pathUtils = require('path') const request = require('supertest') @@ -19,6 +20,7 @@ const testUtils = { flushAndRunMultipleServers: flushAndRunMultipleServers, runServer: runServer, searchVideo: searchVideo, + testImage: testImage, uploadVideo: uploadVideo } @@ -252,6 +254,21 @@ function searchVideo (url, search, end) { .end(end) } +function testImage (url, video_name, image_path, callback) { + request(url) + .get(image_path) + .expect(200) + .end(function (err, res) { + if (err) return callback(err) + + fs.readFile(pathUtils.join(__dirname, 'fixtures', video_name + '.jpg'), function (err, data) { + if (err) return callback(err) + + callback(null, data.equals(res.body)) + }) + }) +} + function uploadVideo (url, access_token, name, description, fixture, special_status, end) { if (!end) { end = special_status