File: test_pluzz.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 (35 lines) | stat: -rw-r--r-- 2,582 bytes parent folder | download
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
import unittest

from streamlink.plugins.pluzz import Pluzz


class TestPluginPluzz(unittest.TestCase):
    def test_can_handle_url(self):
        # should match
        self.assertTrue(Pluzz.can_handle_url("https://www.france.tv/france-2/direct.html"))
        self.assertTrue(Pluzz.can_handle_url("https://www.france.tv/france-3/direct.html"))
        self.assertTrue(Pluzz.can_handle_url("https://www.france.tv/france-3-franche-comte/direct.html"))
        self.assertTrue(Pluzz.can_handle_url("https://www.france.tv/france-4/direct.html"))
        self.assertTrue(Pluzz.can_handle_url("https://www.france.tv/france-5/direct.html"))
        self.assertTrue(Pluzz.can_handle_url("https://www.france.tv/france-o/direct.html"))
        self.assertTrue(Pluzz.can_handle_url("https://www.france.tv/franceinfo/direct.html"))
        self.assertTrue(Pluzz.can_handle_url("https://www.france.tv/france-2/journal-20h00/141003-edition-du-lundi-8-mai-2017.html"))
        self.assertTrue(Pluzz.can_handle_url("https://www.france.tv/france-o/underground/saison-1/132187-underground.html"))
        self.assertTrue(Pluzz.can_handle_url("http://www.ludo.fr/heros/the-batman"))
        self.assertTrue(Pluzz.can_handle_url("http://www.ludo.fr/heros/il-etait-une-fois-la-vie"))
        self.assertTrue(Pluzz.can_handle_url("http://www.zouzous.fr/heros/oui-oui"))
        self.assertTrue(Pluzz.can_handle_url("http://www.zouzous.fr/heros/marsupilami-1"))
        self.assertTrue(Pluzz.can_handle_url("http://france3-regions.francetvinfo.fr/bourgogne-franche-comte/tv/direct/franche-comte"))
        self.assertTrue(Pluzz.can_handle_url("http://sport.francetvinfo.fr/roland-garros/direct"))
        self.assertTrue(Pluzz.can_handle_url("http://sport.francetvinfo.fr/roland-garros/live-court-3"))
        self.assertTrue(Pluzz.can_handle_url("http://sport.francetvinfo.fr/roland-garros/andy-murray-gbr-1-andrey-kuznetsov-rus-1er-tour-court-philippe-chatrier"))
        self.assertTrue(Pluzz.can_handle_url("https://www.francetvinfo.fr/en-direct/tv.html"))

        # shouldn't match
        self.assertFalse(Pluzz.can_handle_url("http://www.france.tv/"))
        self.assertFalse(Pluzz.can_handle_url("http://pluzz.francetv.fr/"))
        self.assertFalse(Pluzz.can_handle_url("http://www.ludo.fr/"))
        self.assertFalse(Pluzz.can_handle_url("http://www.ludo.fr/jeux"))
        self.assertFalse(Pluzz.can_handle_url("http://www.zouzous.fr/"))
        self.assertFalse(Pluzz.can_handle_url("http://www.tvcatchup.com/"))
        self.assertFalse(Pluzz.can_handle_url("http://www.youtube.com/"))