File: test_vinhlongtv.py

package info (click to toggle)
streamlink 8.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,608 kB
  • sloc: python: 51,763; sh: 184; makefile: 152
file content (26 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (4)
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
from unittest.mock import Mock

from freezegun import freeze_time

from streamlink.plugins.vinhlongtv import VinhLongTV
from tests.plugins import PluginCanHandleUrl


class TestPluginCanHandleUrlVinhLongTV(PluginCanHandleUrl):
    __plugin__ = VinhLongTV

    should_match = [
        "https://www.thvli.vn/live/thvl1-hd",
        "https://www.thvli.vn/live/thvl2-hd",
        "https://www.thvli.vn/live/thvl3-hd",
        "https://www.thvli.vn/live/thvl4-hd",
    ]


@freeze_time("2022-09-25T00:04:45Z")
def test_headers():
    # noinspection PyUnresolvedReferences
    assert VinhLongTV(Mock(), "https://www.thvli.vn/live/thvl1-hd")._get_headers() == {
        "X-SFD-Date": "20220925000445",
        "X-SFD-Key": "3507c190ae8befda3bfa8e2c00af3c7a",
    }