1
mirror of https://github.com/streamlink/streamlink synced 2024-11-01 01:19:33 +01:00
streamlink/tests/test_plugin_tvp.py
back-to e1b398bc49
[TVP] New Plugin for Telewizja Polska S.A.
> Telewizja Polska S.A. (TVP S.A., or Polish Television) is a public
broadcasting corporation,
> the only public TV broadcaster in the territory of the Republic of
Poland.
> https://en.wikipedia.org/wiki/Telewizja_Polska

http://tvpstream.vod.tvp.pl
http://tvpstream.vod.tvp.pl/?channel_id=1455

```
[cli][info] Found matching plugin tvp for URL
http://tvpstream.vod.tvp.pl/?channel_id=1455
[cli][info] Available streams: none_101k, 288p_228k (worst), 288p_578k,
288p_1119k, 288p_1797k, 576p_2433k, 576p_3811k (best)
[cli][info] Opening stream: 576p_3811k (hls)
```
2018-04-10 16:38:28 +02:00

21 lines
573 B
Python

import unittest
from streamlink.plugins.tvp import TVP
class TestPluginTVP(unittest.TestCase):
def test_can_handle_url(self):
should_match = [
'http://tvpstream.vod.tvp.pl/?channel_id=14327511',
'http://tvpstream.vod.tvp.pl/?channel_id=1455',
]
for url in should_match:
self.assertTrue(TVP.can_handle_url(url))
should_not_match = [
'http://tvp.pl/',
'http://vod.tvp.pl/',
]
for url in should_not_match:
self.assertFalse(TVP.can_handle_url(url))