File: test_albavision.py

package info (click to toggle)
streamlink 8.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 5,564 kB
  • sloc: python: 51,188; sh: 184; makefile: 152
file content (57 lines) | stat: -rw-r--r-- 2,998 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from streamlink.plugins.albavision import Albavision
from tests.plugins import PluginCanHandleUrl


class TestPluginCanHandleUrlAlbavision(PluginCanHandleUrl):
    __plugin__ = Albavision

    should_match_groups = [
        (("antena7", "https://antena7.com.do/envivo-canal-7/"), {}),
        (("antena7", "https://www.antena7.com.do/envivo-canal7"), {}),
        (("antena7", "https://www.antena7.com.do/envivo-canal7/"), {}),
        (("antena7", "https://www.antena7.com.do/envivo-canal7#"), {}),
        (("antena7", "https://www.antena7.com.do/envivo-canal-7#"), {}),
        (("antena7", "https://www.antena7.com.do/en-vivo-canal-99/"), {}),
        (("antena7", "https://www.antena7.com.do/en-vivo-canal-99#"), {}),
        (("antena7", "https://www.antena7.com.do/envivo-canal-7/"), {}),
        (("antena7", "https://www.antena7.com.do/envivo-canal-21/"), {}),
        (("atv", "https://www.atv.pe/envivo-atv"), {}),
        (("atv", "https://www.atv.pe/envivo-atvmas"), {}),
        (("c9n", "https://www.c9n.com.py/envivo/"), {}),
        (("canal10", "https://www.canal10.com.ni/envivo/"), {}),
        (("canal12", "https://www.canal12.com.sv/envivo/"), {}),
        (("chapintv", "https://www.chapintv.com/envivo-canal-3/"), {}),
        (("chapintv", "https://www.chapintv.com/envivo-canal-7/"), {}),
        (("chapintv", "https://www.chapintv.com/envivo-canal-23/"), {}),
        (("elnueve", "https://www.elnueve.com.ar/en-vivo/"), {}),
        (("redbolivision", "https://www.redbolivision.tv.bo/envivo-canal-5/"), {}),
        (("redbolivision", "https://www.redbolivision.tv.bo/upptv/"), {}),
        (("repretel", "https://www.repretel.com/envivo-canal2/"), {}),
        (("repretel", "https://www.repretel.com/envivo-canal4/"), {}),
        (("repretel", "https://www.repretel.com/envivo-canal6/"), {}),
        (("repretel", "https://www.repretel.com/en-vivo-canal-11/"), {}),
        (("rts", "https://www.rts.com.ec/envivo/"), {}),
        (("snt", "https://www.snt.com.py/envivo/"), {}),
        (("tvc", "https://www.tvc.com.ec/envivo/"), {}),
        (("vtv", "https://www.vtv.com.hn/envivo/"), {}),
    ]

    should_not_match = [
        "https://fake.antena7.com.do/envivo-canal-7/",
        "https://www.antena7.com.do/envivo-canal123",
        "https://www.antena7.com.do/envivo-canal123/",
        "https://www.antena7.com.do/envivo-canal-123",
        "https://www.antena7.com.do/envivo-canal-123/",
        "https://www.antena7.com.do/envivo-canal-123#",
        "https://www.antena7.com.do/envivo-canalabc",
        "https://www.antena7.com.do/envivo-canal-abc",
        "https://www.antena7.com.do/envivo-canal-7/extra",
        "https://www.antena7.com.do/envivo-canal-7#extra",
        "https://www.antena7.com.do/something",
    ]


class TestPluginAlbavision:
    def test_transform(self):
        token = Albavision.transform_token("6b425761cc8a86569b1a05a9bf1870c95fca717dOK", 436171)
        assert token == "6b425761cc8a86569b1a05a9bf1870c95fca717d"