File: test_steam.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 (17 lines) | stat: -rw-r--r-- 920 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import unittest

from streamlink.plugins.steam import SteamBroadcastPlugin


class TestPluginSteamBroadcastPlugin(unittest.TestCase):
    def test_can_handle_url(self):
        self.assertTrue(SteamBroadcastPlugin.can_handle_url('https://steamcommunity.com/broadcast/watch/12432432'))
        self.assertTrue(SteamBroadcastPlugin.can_handle_url('http://steamcommunity.com/broadcast/watch/342342'))
        self.assertTrue(SteamBroadcastPlugin.can_handle_url('https://steam.tv/dota2'))
        self.assertTrue(SteamBroadcastPlugin.can_handle_url('http://steam.tv/dota2'))

    def test_can_handle_url_negative(self):
        # shouldn't match
        self.assertFalse(SteamBroadcastPlugin.can_handle_url('http://steamcommunity.com/broadcast'))
        self.assertFalse(SteamBroadcastPlugin.can_handle_url('https://steamcommunity.com'))
        self.assertFalse(SteamBroadcastPlugin.can_handle_url('https://youtube.com'))