From 7388956d276a0a99cb961227aed79304010d11a8 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 10 Jan 2023 12:37:31 +0300 Subject: [PATCH] Update tests/__data__ --- tests/__data__/expected/_readme.md | 33 +++++++++++++++--- tests/__data__/expected/api/guides.json | 2 +- .../expected/guides/{ => da}/allente.se.json | 2 +- .../expected/guides/{ => da}/allente.se.xml | 0 .../guides/{ => da}/allente.se.xml.gz | Bin .../__data__/expected/guides/en/sky.com.json | 1 + tests/__data__/expected/guides/en/sky.com.xml | 4 +++ .../expected/guides/en/sky.com.xml.gz | Bin 0 -> 377 bytes .../guides/{ => en}/virginmedia.com.json | 2 +- .../guides/{ => en}/virginmedia.com.xml | 0 .../guides/{ => en}/virginmedia.com.xml.gz | Bin .../expected/guides/{ => fr}/sky.com.json | 2 +- .../expected/guides/{ => fr}/sky.com.xml | 2 +- .../expected/guides/fr/sky.com.xml.gz | Bin 0 -> 452 bytes tests/__data__/expected/guides/sky.com.xml.gz | Bin 486 -> 0 bytes .../__data__/expected/logs/guides/update.log | 10 +++--- tests/__data__/input/logs/guides/update.log | 10 +++--- .../input/sites/example.com.config.js | 1 + 18 files changed, 50 insertions(+), 19 deletions(-) rename tests/__data__/expected/guides/{ => da}/allente.se.json (97%) rename tests/__data__/expected/guides/{ => da}/allente.se.xml (100%) rename tests/__data__/expected/guides/{ => da}/allente.se.xml.gz (100%) create mode 100644 tests/__data__/expected/guides/en/sky.com.json create mode 100644 tests/__data__/expected/guides/en/sky.com.xml create mode 100644 tests/__data__/expected/guides/en/sky.com.xml.gz rename tests/__data__/expected/guides/{ => en}/virginmedia.com.json (92%) rename tests/__data__/expected/guides/{ => en}/virginmedia.com.xml (100%) rename tests/__data__/expected/guides/{ => en}/virginmedia.com.xml.gz (100%) rename tests/__data__/expected/guides/{ => fr}/sky.com.json (79%) rename tests/__data__/expected/guides/{ => fr}/sky.com.xml (56%) create mode 100644 tests/__data__/expected/guides/fr/sky.com.xml.gz delete mode 100644 tests/__data__/expected/guides/sky.com.xml.gz diff --git a/tests/__data__/expected/_readme.md b/tests/__data__/expected/_readme.md index 4a0ea3ff..a0e36cfc 100644 --- a/tests/__data__/expected/_readme.md +++ b/tests/__data__/expected/_readme.md @@ -10,19 +10,44 @@ To load a program guide, all you need to do is copy the link to one or more of t ## Guides +All guides also have a compressed and JSON version. To load them just change the extension from `.xml` to `.xml.gz` or `.json` respectively. + +### Danish + - - - +
SiteChannelsEPGStatus                                                   
allente.se1https://iptv-org.github.io/epg/guides/allente.se.xmlallente.se
sky.com1https://iptv-org.github.io/epg/guides/sky.com.xmlsky.com
virginmedia.com1https://iptv-org.github.io/epg/guides/virginmedia.com.xmlvirginmedia.com
allente.se1https://iptv-org.github.io/epg/guides/da/allente.se.xmlallente.se
-All guides also have a compressed and JSON version. To download them, simply change the extension from `.xml` to `.xml.gz` or `.json` respectively. +### English + + + + + + + + + +
SiteChannelsEPGStatus                                                   
sky.com1https://iptv-org.github.io/epg/guides/en/sky.com.xmlsky.com
virginmedia.com1https://iptv-org.github.io/epg/guides/en/virginmedia.com.xmlvirginmedia.com
+ +### French + + + + + + + + +
SiteChannelsEPGStatus                                                   
sky.com2https://iptv-org.github.io/epg/guides/fr/sky.com.xmlsky.com
+ + ## Contribution diff --git a/tests/__data__/expected/api/guides.json b/tests/__data__/expected/api/guides.json index a25bcba9..458eaf5e 100644 --- a/tests/__data__/expected/api/guides.json +++ b/tests/__data__/expected/api/guides.json @@ -1 +1 @@ -[{"channel":"6eren.dk","site":"allente.se","lang":"en","url":"https://iptv-org.github.io/epg/guides/allente.se.xml"},{"channel":"6eren.dk","site":"allente.se","lang":"da","url":"https://iptv-org.github.io/epg/guides/allente.se.xml"},{"channel":"BBCNews.uk","site":"virginmedia.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/virginmedia.com.xml"},{"channel":"BBCNews.uk","site":"sky.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/sky.com.xml"},{"channel":"BBCNews.uk","site":"sky.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/sky.com.xml"}] \ No newline at end of file +[{"channel":"6eren.dk","site":"allente.se","lang":"da","days":2,"url":"https://iptv-org.github.io/epg/guides/da/allente.se.xml"},{"channel":"BBCNews.uk","site":"virginmedia.com","lang":"en","days":2,"url":"https://iptv-org.github.io/epg/guides/en/virginmedia.com.xml"},{"channel":"BBCNews.uk","site":"sky.com","lang":"fr","days":2,"url":"https://iptv-org.github.io/epg/guides/fr/sky.com.xml"},{"channel":"BBCNews.uk","site":"sky.com","lang":"en","days":2,"url":"https://iptv-org.github.io/epg/guides/en/sky.com.xml"},{"channel":"CNN.us","site":"sky.com","lang":"fr","days":2,"url":"https://iptv-org.github.io/epg/guides/fr/sky.com.xml"}] \ No newline at end of file diff --git a/tests/__data__/expected/guides/allente.se.json b/tests/__data__/expected/guides/da/allente.se.json similarity index 97% rename from tests/__data__/expected/guides/allente.se.json rename to tests/__data__/expected/guides/da/allente.se.json index 37dcb8ba..1b04e3f4 100644 --- a/tests/__data__/expected/guides/allente.se.json +++ b/tests/__data__/expected/guides/da/allente.se.json @@ -1 +1 @@ -{"channels":[{"id":"6eren.dk","name":"6'eren","site":"allente.se","lang":"da","logo":"https://upload.wikimedia.org/wikipedia/commons/6/64/6%27eren_2015.png","url":"https://allente.se"}],"programs":[{"site":"allente.se","channel":"6eren.dk","titles":[{"value":"Diners, Drive-Ins and Dives","lang":"da"}],"sub_titles":[],"descriptions":[{"value":"Underholdning","lang":"da"}],"icon":{"src":"https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/487/2022-10-24/se.cs.6eren.event.B_0254194276971024040000.jpg?size=2560x1440"},"episodeNumbers":[{"system":"xmltv_ns","value":"23.5.0/1"},{"system":"onscreen","value":"S24E06"}],"date":null,"start":1666584000000,"stop":1666585500000,"urls":[],"ratings":[],"categories":[{"value":"series","lang":"da"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file +{"channels":[{"id":"6eren.dk","name":"6'eren","site":"allente.se","lang":"da","logo":"https://upload.wikimedia.org/wikipedia/commons/6/64/6%27eren_2015.png","url":"https://allente.se"}],"programs":[{"site":"allente.se","channel":"6eren.dk","titles":[{"value":"Diners, Drive-Ins and Dives","lang":"da"}],"sub_titles":[],"descriptions":[{"value":"Underholdning","lang":"da"}],"icon":{"src":"https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/487/2022-10-24/se.cs.6eren.event.B_0254194276971024040000.jpg?size=2560x1440"},"episodeNumbers":[{"system":"xmltv_ns","value":"23.5.0/1"},{"system":"onscreen","value":"S24E06"}],"date":null,"start":1666584000000,"stop":1666585500000,"urls":[],"ratings":[],"categories":[{"value":"series","lang":"da"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}],"date":"2022-10-20"} \ No newline at end of file diff --git a/tests/__data__/expected/guides/allente.se.xml b/tests/__data__/expected/guides/da/allente.se.xml similarity index 100% rename from tests/__data__/expected/guides/allente.se.xml rename to tests/__data__/expected/guides/da/allente.se.xml diff --git a/tests/__data__/expected/guides/allente.se.xml.gz b/tests/__data__/expected/guides/da/allente.se.xml.gz similarity index 100% rename from tests/__data__/expected/guides/allente.se.xml.gz rename to tests/__data__/expected/guides/da/allente.se.xml.gz diff --git a/tests/__data__/expected/guides/en/sky.com.json b/tests/__data__/expected/guides/en/sky.com.json new file mode 100644 index 00000000..4a49b379 --- /dev/null +++ b/tests/__data__/expected/guides/en/sky.com.json @@ -0,0 +1 @@ +{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"sky.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://sky.com"}],"programs":[{"site":"sky.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news from the BBC. [S,SL]","lang":"en"}],"icon":{"src":"http://epgstatic.sky.com/epgdata/1.0/paimage/46/1/lisa/5.2.2/linear/channel/ca247bc8-6be0-48f9-88d1-865f87f7680e/2011"},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}],"date":"2022-10-20"} \ No newline at end of file diff --git a/tests/__data__/expected/guides/en/sky.com.xml b/tests/__data__/expected/guides/en/sky.com.xml new file mode 100644 index 00000000..1eeac223 --- /dev/null +++ b/tests/__data__/expected/guides/en/sky.com.xml @@ -0,0 +1,4 @@ + +BBC Newshttps://sky.com +BBC News at OneThe latest national and international news from the BBC. [S,SL] + \ No newline at end of file diff --git a/tests/__data__/expected/guides/en/sky.com.xml.gz b/tests/__data__/expected/guides/en/sky.com.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..c3f1f279c8c741a25937fd54480ba4bd02bfe2a4 GIT binary patch literal 377 zcmV-<0fzn`iwFP!000006J3!(Yuqpph3|py*ty6X|D!KE{zN$6)Nn-X(pfqUp*WAXUKzdv}d-5UHOza zCh(LpVj6*b56&kJr;0B@+b~a%vOh;l_;LUC{>#ryEa$x@l?m`N`SSU9I%?eWi8ZRC;~2)tl{Rt!qYA XH%;M>C$xn#rbG7^Z`vxII|2XzEoQvk literal 0 HcmV?d00001 diff --git a/tests/__data__/expected/guides/virginmedia.com.json b/tests/__data__/expected/guides/en/virginmedia.com.json similarity index 92% rename from tests/__data__/expected/guides/virginmedia.com.json rename to tests/__data__/expected/guides/en/virginmedia.com.json index 5ff6b490..85e4504f 100644 --- a/tests/__data__/expected/guides/virginmedia.com.json +++ b/tests/__data__/expected/guides/en/virginmedia.com.json @@ -1 +1 @@ -{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"virginmedia.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://virginmedia.com"}],"programs":[{"site":"virginmedia.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news, followed by weather.","lang":"en"}],"icon":{"src":""},"episodeNumbers":[{"system":"xmltv_ns","value":"96839999.145799123.0/1"},{"system":"onscreen","value":"S96840000E145799124"}],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[{"value":"News","lang":"en"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file +{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"virginmedia.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://virginmedia.com"}],"programs":[{"site":"virginmedia.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news, followed by weather.","lang":"en"}],"icon":{"src":""},"episodeNumbers":[{"system":"xmltv_ns","value":"96839999.145799123.0/1"},{"system":"onscreen","value":"S96840000E145799124"}],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[{"value":"News","lang":"en"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}],"date":"2022-10-20"} \ No newline at end of file diff --git a/tests/__data__/expected/guides/virginmedia.com.xml b/tests/__data__/expected/guides/en/virginmedia.com.xml similarity index 100% rename from tests/__data__/expected/guides/virginmedia.com.xml rename to tests/__data__/expected/guides/en/virginmedia.com.xml diff --git a/tests/__data__/expected/guides/virginmedia.com.xml.gz b/tests/__data__/expected/guides/en/virginmedia.com.xml.gz similarity index 100% rename from tests/__data__/expected/guides/virginmedia.com.xml.gz rename to tests/__data__/expected/guides/en/virginmedia.com.xml.gz diff --git a/tests/__data__/expected/guides/sky.com.json b/tests/__data__/expected/guides/fr/sky.com.json similarity index 79% rename from tests/__data__/expected/guides/sky.com.json rename to tests/__data__/expected/guides/fr/sky.com.json index 6aba8984..e6e8888e 100644 --- a/tests/__data__/expected/guides/sky.com.json +++ b/tests/__data__/expected/guides/fr/sky.com.json @@ -1 +1 @@ -{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"sky.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://sky.com"},{"id":"CNN.us","name":"CNN","site":"sky.com","lang":"fr","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","url":"https://sky.com"}],"programs":[{"site":"sky.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"},{"value":"BBC News at One","lang":"fr"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news from the BBC. [S,SL]","lang":"en"},{"value":"Les dernières nouvelles nationales et internationales de la BBC. [S,SL]","lang":"fr"}],"icon":{"src":"http://epgstatic.sky.com/epgdata/1.0/paimage/46/1/lisa/5.2.2/linear/channel/ca247bc8-6be0-48f9-88d1-865f87f7680e/2011"},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]},{"site":"sky.com","channel":"CNN.us","titles":[{"value":"French title","lang":"fr"}],"sub_titles":[],"descriptions":[],"icon":{"src":""},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file +{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"sky.com","lang":"fr","logo":"https://i.imgur.com/rPzH88J.png","url":"https://sky.com"},{"id":"CNN.us","name":"CNN","site":"sky.com","lang":"fr","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","url":"https://sky.com"}],"programs":[{"site":"sky.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"fr"}],"sub_titles":[],"descriptions":[{"value":"Les dernières nouvelles nationales et internationales de la BBC. [S,SL]","lang":"fr"}],"icon":{"src":"http://epgstatic.sky.com/epgdata/1.0/paimage/46/1/lisa/5.2.2/linear/channel/ca247bc8-6be0-48f9-88d1-865f87f7680e/2011"},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]},{"site":"sky.com","channel":"CNN.us","titles":[{"value":"French title","lang":"fr"}],"sub_titles":[],"descriptions":[],"icon":{"src":""},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}],"date":"2022-10-20"} \ No newline at end of file diff --git a/tests/__data__/expected/guides/sky.com.xml b/tests/__data__/expected/guides/fr/sky.com.xml similarity index 56% rename from tests/__data__/expected/guides/sky.com.xml rename to tests/__data__/expected/guides/fr/sky.com.xml index 454db214..d04dc456 100644 --- a/tests/__data__/expected/guides/sky.com.xml +++ b/tests/__data__/expected/guides/fr/sky.com.xml @@ -1,6 +1,6 @@ BBC Newshttps://sky.com CNNhttps://sky.com -BBC News at OneBBC News at OneThe latest national and international news from the BBC. [S,SL]Les dernières nouvelles nationales et internationales de la BBC. [S,SL] +BBC News at OneLes dernières nouvelles nationales et internationales de la BBC. [S,SL] French title \ No newline at end of file diff --git a/tests/__data__/expected/guides/fr/sky.com.xml.gz b/tests/__data__/expected/guides/fr/sky.com.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..ededb1dd6cb1c3c90c14c7bd283f8861a388c3af GIT binary patch literal 452 zcmV;#0XzO5iwFP!000006RnfMirX*{hVO;GgV43L#&(lfTVyZn!cxkT7PdW=9<=hr z5s_sh$xgRV)c4pIs~i$Hn@cIw2Q&Qhqxt=5EUtgFhK%UE?rcdjmQsRNb+xulNxy!% zOE@Lhl?WrLWx$f=X`W|kp3>^|E1|a1S~Nu0CB3=1UE|)fVMi-bYu_9Blvvqf6+2{V z33wq3tvXA*QzhMo(EIlQn(4L~98+Bj?(@$NoPT7!Z75V?aHcxh{O)P82$)0x#}t== zZr5uz_{%U+{dV?n-gS+WZHvSQ z>B7vl$nrEkTp zI;)?5xmen67}1!ik|Az}oJtHt+Yn8EqT1UC6kyqw3I@95W}09H;;Ma?D~5v$%xvBPUSRWAtk8Ft`e%r>6gd5 zAf@EG$m~ceZZW5E7{^f4*k21!{NXxp|P~%q(!v6K?AaDI&&IlpyGNDlIsRxom~B!&|Y_q=533_ zSg!57*CdKV_mMaLr7qd^=ec)hxg*=f=B=<2iR9isRCHcG;g)<-n88%AtgH2(>nb$m z8QtT~H(4~6C~n=&a7nnTh)@>wj3`f3>#il%)jMiNzCOHtxc}x>@Aww1e)v5aQn`Nd z@>9D|b;F2K`sm2$LbS^vQ;XyH9sSZ#X9V_*+p`rVJ6hrqchDT%#Y4|0gJHFS2&6C^ z)+}bR3l(yGvJFZeuac)S4K`002CKBb3evQSf^@U4)1*!|X^0SqQRL46W{3Z`-Sb^v cT6m}3pSvRyJo~rQ0d_2Y0Ydv0x$^@60P}tJ{r~^~ diff --git a/tests/__data__/expected/logs/guides/update.log b/tests/__data__/expected/logs/guides/update.log index a1fd872d..bf20652e 100644 --- a/tests/__data__/expected/logs/guides/update.log +++ b/tests/__data__/expected/logs/guides/update.log @@ -1,5 +1,5 @@ -{"lang":"da","site":"allente.se","channel":"6eren.dk","filename":"allente.se"} -{"lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"virginmedia.com"} -{"lang":"en","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com"} -{"lang":"fr","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com"} -{"lang":"fr","site":"sky.com","channel":"CNN.us","filename":"sky.com"} \ No newline at end of file +{"site":"allente.se","lang":"da","days":2,"channel":"6eren.dk","filename":"da/allente.se"} +{"site":"virginmedia.com","lang":"en","days":2,"channel":"BBCNews.uk","filename":"en/virginmedia.com"} +{"site":"sky.com","lang":"fr","days":2,"channel":"BBCNews.uk","filename":"fr/sky.com"} +{"site":"sky.com","lang":"fr","days":2,"channel":"CNN.us","filename":"fr/sky.com"} +{"site":"sky.com","lang":"en","days":2,"channel":"BBCNews.uk","filename":"en/sky.com"} \ No newline at end of file diff --git a/tests/__data__/input/logs/guides/update.log b/tests/__data__/input/logs/guides/update.log index 1e9a9cc3..bf20652e 100644 --- a/tests/__data__/input/logs/guides/update.log +++ b/tests/__data__/input/logs/guides/update.log @@ -1,5 +1,5 @@ -{"lang":"en","site":"allente.se","channel":"6eren.dk","filename":"allente.se"} -{"lang":"da","site":"allente.se","channel":"6eren.dk","filename":"allente.se"} -{"lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"virginmedia.com"} -{"lang":"en","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com"} -{"lang":"fr","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com"} +{"site":"allente.se","lang":"da","days":2,"channel":"6eren.dk","filename":"da/allente.se"} +{"site":"virginmedia.com","lang":"en","days":2,"channel":"BBCNews.uk","filename":"en/virginmedia.com"} +{"site":"sky.com","lang":"fr","days":2,"channel":"BBCNews.uk","filename":"fr/sky.com"} +{"site":"sky.com","lang":"fr","days":2,"channel":"CNN.us","filename":"fr/sky.com"} +{"site":"sky.com","lang":"en","days":2,"channel":"BBCNews.uk","filename":"en/sky.com"} \ No newline at end of file diff --git a/tests/__data__/input/sites/example.com.config.js b/tests/__data__/input/sites/example.com.config.js index 20384029..e420f308 100644 --- a/tests/__data__/input/sites/example.com.config.js +++ b/tests/__data__/input/sites/example.com.config.js @@ -1,5 +1,6 @@ module.exports = { site: 'example.com', + days: 2, url() { return `https://example.com` },