From ea954fec380244e16482c6073cb376a8b1c5ae5c Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 4 May 2026 18:01:25 +0300 Subject: [PATCH] Update tests/__data__ --- .../expected/api_generate/guides.json | 1 - .../expected/guides_export/guides.json | 1 + .../expected/workers_load/workers.json | 1 + .../example.com/example.com.channels.xml | 10 +++---- .../example2.com/example2.com.channels.xml | 10 +++---- .../__data__/input/guides_update/workers.json | 29 +++++++++++++++++++ .../channels.xml | 0 .../{guides_update => workers_load}/guide.xml | 2 +- .../worker.json | 0 .../workers.txt | 0 10 files changed, 42 insertions(+), 12 deletions(-) delete mode 100644 tests/__data__/expected/api_generate/guides.json create mode 100644 tests/__data__/expected/guides_export/guides.json create mode 100644 tests/__data__/expected/workers_load/workers.json rename tests/__data__/input/{api_generate => guides_export}/sites/example.com/example.com.channels.xml (98%) rename tests/__data__/input/{api_generate => guides_export}/sites/example2.com/example2.com.channels.xml (98%) create mode 100644 tests/__data__/input/guides_update/workers.json rename tests/__data__/input/{guides_update => workers_load}/channels.xml (100%) rename tests/__data__/input/{guides_update => workers_load}/guide.xml (97%) rename tests/__data__/input/{guides_update => workers_load}/worker.json (100%) rename tests/__data__/input/{guides_update => workers_load}/workers.txt (100%) diff --git a/tests/__data__/expected/api_generate/guides.json b/tests/__data__/expected/api_generate/guides.json deleted file mode 100644 index b658a7821..000000000 --- a/tests/__data__/expected/api_generate/guides.json +++ /dev/null @@ -1 +0,0 @@ -[{"channel":"Channel1.us","feed":"SD","site":"example.com","site_id":"140","site_name":"Channel 1","lang":"en"},{"channel":"Channel2.us","feed":null,"site":"example.com","site_id":"142","site_name":"Channel 2","lang":"en"},{"channel":"Channel1.us","feed":"HD","site":"example.com","site_id":"140","site_name":"Channel 1","lang":"fr"},{"channel":"Channel3.us","feed":"HD","site":"example2.com","site_id":"150","site_name":"Channel 3","lang":"en"},{"channel":"Channel4.us","feed":null,"site":"example2.com","site_id":"152","site_name":"Channel 4","lang":"en"},{"channel":"Channel1.us","feed":null,"site":"example2.com","site_id":"140","site_name":"Channel 1","lang":"fr"}] \ No newline at end of file diff --git a/tests/__data__/expected/guides_export/guides.json b/tests/__data__/expected/guides_export/guides.json new file mode 100644 index 000000000..1239c7edf --- /dev/null +++ b/tests/__data__/expected/guides_export/guides.json @@ -0,0 +1 @@ +[{"channel":"Channel1.us","feed":"SD","site":"example.com","site_id":"140","site_name":"Channel 1","lang":"en","sources":[]},{"channel":"Channel2.us","feed":null,"site":"example.com","site_id":"142","site_name":"Channel 2","lang":"en","sources":[]},{"channel":"Channel1.us","feed":"HD","site":"example.com","site_id":"140","site_name":"Channel 1","lang":"fr","sources":[]},{"channel":"Channel3.us","feed":"HD","site":"example2.com","site_id":"150","site_name":"Channel 3","lang":"en","sources":[]},{"channel":"Channel4.us","feed":null,"site":"example2.com","site_id":"152","site_name":"Channel 4","lang":"en","sources":[]},{"channel":"Channel1.us","feed":null,"site":"example2.com","site_id":"140","site_name":"Channel 1","lang":"fr","sources":[]}] \ No newline at end of file diff --git a/tests/__data__/expected/workers_load/workers.json b/tests/__data__/expected/workers_load/workers.json new file mode 100644 index 000000000..5884dd7af --- /dev/null +++ b/tests/__data__/expected/workers_load/workers.json @@ -0,0 +1 @@ +[{"host":"example.com","channels":[],"status":"MISSING_WORKER_CONFIG"},{"host":"worker-9dd4.onrender.com","channelsPath":"channels.xml","channels":[{"xmltv_id":"ANT1Europe.gr@SD","name":"ANT1 Europe","site":"antennaeurope.gr","site_id":"#","lang":"el","logo":null,"url":null,"lcn":null,"index":0}],"guideXmlPath":"guide.xml","guideGzipPath":"guide.xml.gz","guideJsonPath":"guide.json","status":"OK","lastUpdated":"2022-10-03T00:00:00.000Z"}] \ No newline at end of file diff --git a/tests/__data__/input/api_generate/sites/example.com/example.com.channels.xml b/tests/__data__/input/guides_export/sites/example.com/example.com.channels.xml similarity index 98% rename from tests/__data__/input/api_generate/sites/example.com/example.com.channels.xml rename to tests/__data__/input/guides_export/sites/example.com/example.com.channels.xml index 630e9225e..c0c4c2ffa 100644 --- a/tests/__data__/input/api_generate/sites/example.com/example.com.channels.xml +++ b/tests/__data__/input/guides_export/sites/example.com/example.com.channels.xml @@ -1,6 +1,6 @@ - - - Channel 1 - Channel 2 - Channel 1 + + + Channel 1 + Channel 2 + Channel 1 \ No newline at end of file diff --git a/tests/__data__/input/api_generate/sites/example2.com/example2.com.channels.xml b/tests/__data__/input/guides_export/sites/example2.com/example2.com.channels.xml similarity index 98% rename from tests/__data__/input/api_generate/sites/example2.com/example2.com.channels.xml rename to tests/__data__/input/guides_export/sites/example2.com/example2.com.channels.xml index f95bdb8dc..edb959bae 100644 --- a/tests/__data__/input/api_generate/sites/example2.com/example2.com.channels.xml +++ b/tests/__data__/input/guides_export/sites/example2.com/example2.com.channels.xml @@ -1,6 +1,6 @@ - - - Channel 3 - Channel 4 - Channel 1 + + + Channel 3 + Channel 4 + Channel 1 \ No newline at end of file diff --git a/tests/__data__/input/guides_update/workers.json b/tests/__data__/input/guides_update/workers.json new file mode 100644 index 000000000..314483d59 --- /dev/null +++ b/tests/__data__/input/guides_update/workers.json @@ -0,0 +1,29 @@ +[ + { + "host": "example.com", + "channels": [], + "status": "MISSING_WORKER_CONFIG" + }, + { + "host": "worker-9dd4.onrender.com", + "channelsPath": "channels.xml", + "channels": [ + { + "xmltv_id": "ANT1Europe.gr@SD", + "name": "ANT1 Europe", + "site": "antennaeurope.gr", + "site_id": "#", + "lang": "el", + "logo": null, + "url": null, + "lcn": null, + "index": 0 + } + ], + "guideXmlPath": "guide.xml", + "guideGzipPath": "guide.xml.gz", + "guideJsonPath": "guide.json", + "status": "OK", + "lastUpdated": "2022-10-03T00:00:00.000Z" + } +] \ No newline at end of file diff --git a/tests/__data__/input/guides_update/channels.xml b/tests/__data__/input/workers_load/channels.xml similarity index 100% rename from tests/__data__/input/guides_update/channels.xml rename to tests/__data__/input/workers_load/channels.xml diff --git a/tests/__data__/input/guides_update/guide.xml b/tests/__data__/input/workers_load/guide.xml similarity index 97% rename from tests/__data__/input/guides_update/guide.xml rename to tests/__data__/input/workers_load/guide.xml index ed17438ed..ddc29c7b0 100644 --- a/tests/__data__/input/guides_update/guide.xml +++ b/tests/__data__/input/workers_load/guide.xml @@ -1,4 +1,4 @@ - + ANT1 Europehttps://antennaeurope.gr ΚΑΛΗΜΕΡΑ ΕΛΛΑΔΑ ΤΟ ΠΡΩΙΝΟ diff --git a/tests/__data__/input/guides_update/worker.json b/tests/__data__/input/workers_load/worker.json similarity index 100% rename from tests/__data__/input/guides_update/worker.json rename to tests/__data__/input/workers_load/worker.json diff --git a/tests/__data__/input/guides_update/workers.txt b/tests/__data__/input/workers_load/workers.txt similarity index 100% rename from tests/__data__/input/guides_update/workers.txt rename to tests/__data__/input/workers_load/workers.txt