예제 #1
0
 def test_get_login_link(self):
     """ADD ME"""
     constants = Constants()
     self.assertEqual(
         first=constants.get_login_link(),
         second=
         'https://www.telekomsport.de/service/auth/web/login?headto=https://www.telekomsport.de/info'
     )
예제 #2
0
 def test_get_stream_definition_url(self):
     """ADD ME"""
     base = 'https://www.telekomsport.de'
     route = '/service/player/streamAccess'
     params = '?videoId=%VIDEO_ID%&label=2780_hls'
     constants = Constants()
     self.assertEqual(first=constants.get_stream_definition_url(),
                      second=base + route + params)
예제 #3
0
 def test_get_sports_list(self):
     """ADD ME"""
     constants = Constants()
     sports = constants.get_sports_list()
     sports_keys = sports.keys()
     self.assertIn('liga3', sports_keys)
     self.assertIn('del', sports_keys)
     self.assertIn('ffb', sports_keys)
     self.assertIn('fcb', sports_keys)
     self.assertIn('bbl', sports_keys)
     self.assertIn('bel', sports_keys)
     self.assertIn('skybuli', sports_keys)
     self.assertIn('skychamp', sports_keys)
     self.assertIn('skyhandball', sports_keys)
예제 #4
0
 def test_get_user_agent_Windows(self, mock_system):
     """ADD ME"""
     mock_system.return_value = 'Windows'
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     self.assertIn(
         container=utils.get_user_agent(),
         member='Win')
예제 #5
0
 def test_get_use_inputstream_high_inputstream(self, mock_executeJSONRPC, mock_executeJSONRPC2):
     mock_executeJSONRPC.return_value = '{"result": {"version": {"major": 18}}}'
     mock_executeJSONRPC2.return_value = '{"result": {"addon": {"enabled": true, "version": "12.1.7"}}}'
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     self.assertEquals(
         first=utils.use_inputstream(),
         second=False)
예제 #6
0
 def test_get_use_inputstream_low_inputstream(self, mock_executeJSONRPC):
     mock_executeJSONRPC.return_value = '{"result": {"version": {"major": 18}}}'
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     def return_low_version():
         return '0.9.9'
     utils.get_inputstream_version = return_low_version
     self.assertEquals(
         first=utils.use_inputstream(),
         second=False)
예제 #7
0
 def test_capitalize(self):
     """ADD ME"""
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     self.assertEquals(
         first=utils.capitalize('foo bar'),
         second='Foo Bar')
     self.assertEquals(
         first=utils.capitalize('FOO BAR'),
         second='Foo Bar')
     self.assertEquals(
         first=utils.capitalize('Foo Bar'),
         second='Foo Bar')
예제 #8
0
 def test_get_localized_string_unicode(self, mock_xbmcaddon):
     mock_xbmcaddon.return_value = MockAddon()
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     self.assertEquals(
         first=utils.get_local_string(30001),
         second='Foo')
예제 #9
0
 def test_get_use_inputstream_setting_off(self, mock_xbmcaddon):
     mock_xbmcaddon.return_value = MockAddon()
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     self.assertEquals(
         first=utils.use_inputstream(),
         second=False)
예제 #10
0
 def test_get_inputstream_version_no_version(self, mock_executeJSONRPC):
     mock_executeJSONRPC.return_value = '{"result": {"addon": {"enabled": true}}}'
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     self.assertEquals(
         first=utils.get_inputstream_version(),
         second='1.0.0')
예제 #11
0
 def test_get_addon(self):
     """ADD ME"""
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     self.assertIn(
         container=str(utils.get_addon()),
         member='xbmcaddon.Addon')
예제 #12
0
 def test_get_kodi_version_error_response(self, mock_executeJSONRPC):
     mock_executeJSONRPC.return_value = '{"error": true}'
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     self.assertEquals(
         first=utils.get_kodi_version(),
         second=17)
예제 #13
0
 def test_get_kodi_version_local_version(self, mock_executeJSONRPC):
     mock_executeJSONRPC.return_value = '{"result": {"version": {"major": 18}}}'
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     self.assertEquals(
         first=utils.get_kodi_version(),
         second=18)
예제 #14
0
 def test_get_statics_list(self):
     """ADD ME"""
     constants = Constants()
     statics = constants.get_statics_list()
     statics_keys = statics.keys()
     self.assertIn('liga3', statics_keys)
예제 #15
0
 def test_get_epg_url(self):
     """ADD ME"""
     constants = Constants()
     self.assertEqual(first=constants.get_epg_url(),
                      second='https://www.telekomsport.de/api/v1/')
예제 #16
0
 def test_get_login_endpoint(self):
     """ADD ME"""
     constants = Constants()
     self.assertEqual(first=constants.get_login_endpoint(),
                      second='https://accounts.login.idm.telekom.com/sso')
예제 #17
0
 def test_generate_hash(self):
     """ADD ME"""
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     self.assertEquals(
         first=utils.generate_hash('ABCDEFG'),
         second='bae3735e5822d8c30fafd70736316e7807f7cccf65e6e73c15f32a60')
예제 #18
0
 def test_get_use_inputstream_error(self, mock_executeJSONRPC):
     mock_executeJSONRPC.return_value = '{"error": true}'
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     self.assertEquals(
         first=utils.use_inputstream(),
         second=False)
예제 #19
0
 def test_build_url(self):
     """ADD ME"""
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     self.assertIn(
         container=utils.build_url({'bar': 'baz'}),
         member='/foo/?bar=baz')
예제 #20
0
 def test_get_user_agent(self):
     """ADD ME"""
     utils = Utils(kodi_base_url='/foo/', constants=Constants())
     self.assertIn(
         container=utils.get_user_agent(),
         member='Chrome/59.0.3071.115')
예제 #21
0
# setup plugin base stuff
try:
    PLUGIN_HANDLE = int(argv[1])
    KODI_BASE_URL = argv[0]
except ValueError:
    PLUGIN_HANDLE = 1
    KODI_BASE_URL = ''

try:
    from urllib.parse import parse_qsl
except:
    from urlparse import parse_qsl

# init plugin object structure
CONSTANTS = Constants()
CACHE = Cache()
UTILS = Utils(constants=CONSTANTS, kodi_base_url=KODI_BASE_URL)
DIALOGS = Dialogs(utils=UTILS)
ITEM_HELPER = ItemHelper(constants=CONSTANTS, utils=UTILS)
SETTINGS = Settings(utils=UTILS, dialogs=DIALOGS, constants=CONSTANTS)
SESSION = Session(constants=CONSTANTS, util=UTILS, settings=SETTINGS)
CONTENT_LOADER = ContentLoader(
    session=SESSION,
    item_helper=ITEM_HELPER,
    cache=CACHE,
    handle=PLUGIN_HANDLE)


def router(paramstring):
    """
예제 #22
0
 def test_get_addon_id(self):
     """ADD ME"""
     constants = Constants()
     self.assertEqual(first=constants.get_addon_id(),
                      second='plugin.video.telekom-sport')