Add direct IPTV streams to the retroLabs guide
This commit is contained in:
@@ -26,6 +26,7 @@ class BridgeTest(unittest.TestCase):
|
||||
self.app = create_app(
|
||||
tunarr_url="http://tunarr:8000", transport=httpx.MockTransport(self.upstream),
|
||||
discover=False, id_file=Path(temporary.name) / "server-id",
|
||||
iptv_file=Path(temporary.name) / "channels.json",
|
||||
)
|
||||
self.client = self.enterContext(TestClient(self.app))
|
||||
|
||||
@@ -105,3 +106,21 @@ class BridgeTest(unittest.TestCase):
|
||||
self.assertEqual(program_title(episode, "The Rookie"), "The Rookie S01E01")
|
||||
episode["program"]["title"] = "The Rookie S01E01 Pilot"
|
||||
self.assertEqual(program_title(episode, "The Rookie"), "The Rookie S01E01 · Pilot")
|
||||
|
||||
def test_iptv_joins_lineup_without_tunarr_programming(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
path = Path(directory) / "channels.json"
|
||||
path.write_text(
|
||||
'[{"id":"sports","name":"Sports","number":12,'
|
||||
'"url":"https://example.com/live.m3u8"}]'
|
||||
)
|
||||
app = create_app(
|
||||
transport=httpx.MockTransport(self.upstream), discover=False,
|
||||
id_file=path.with_name("server-id"), iptv_file=path,
|
||||
)
|
||||
with TestClient(app) as client:
|
||||
channels = client.get("/api/v1/channels").json()["channels"]
|
||||
self.assertEqual(channels[0]["streamUrl"], "https://example.com/live.m3u8")
|
||||
self.assertEqual(channels[0]["type"], "iptv")
|
||||
self.assertEqual(client.get("/api/v1/guide").json()["channels"][0]["programs"], [])
|
||||
self.assertIsNone(client.get("/api/v1/channels/iptv-sports/now").json()["now"])
|
||||
|
||||
Reference in New Issue
Block a user