File: test_tf1.py

package info (click to toggle)
streamlink 1.0.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,588 kB
  • sloc: python: 31,121; makefile: 141; sh: 93
file content (22 lines) | stat: -rw-r--r-- 1,031 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import unittest

from streamlink.plugins.tf1 import TF1


class TestPluginTF1(unittest.TestCase):
    def test_can_handle_url(self):
        # should match
        self.assertTrue(TF1.can_handle_url("http://tf1.fr/tf1/direct/"))
        self.assertTrue(TF1.can_handle_url("http://tf1.fr/tfx/direct/"))
        self.assertTrue(TF1.can_handle_url("http://tf1.fr/tf1-series-films/direct/"))
        self.assertTrue(TF1.can_handle_url("http://lci.fr/direct"))
        self.assertTrue(TF1.can_handle_url("http://www.lci.fr/direct"))
        self.assertTrue(TF1.can_handle_url("http://tf1.fr/tmc/direct"))
        self.assertTrue(TF1.can_handle_url("http://tf1.fr/lci/direct"))

    def test_can_handle_url_negative(self):
        # shouldn't match
        self.assertFalse(TF1.can_handle_url("http://tf1.fr/direct"))
        self.assertFalse(TF1.can_handle_url("http://www.tf1.fr/direct"))
        self.assertFalse(TF1.can_handle_url("http://www.tvcatchup.com/"))
        self.assertFalse(TF1.can_handle_url("http://www.youtube.com/"))