|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 3 | + |
| 4 | +# pylint: disable=missing-docstring |
| 5 | + |
| 6 | +import unittest |
| 7 | +import platform |
| 8 | + |
| 9 | + |
| 10 | +import inputstreamhelper |
| 11 | +from test_utils import delete_cached, cleanup |
| 12 | + |
| 13 | +xbmc = __import__('xbmc') |
| 14 | +xbmcaddon = __import__('xbmcaddon') |
| 15 | +xbmcgui = __import__('xbmcgui') |
| 16 | +xbmcvfs = __import__('xbmcvfs') |
| 17 | + |
| 18 | + |
| 19 | +class WindowsARM64Tests(unittest.TestCase): |
| 20 | + |
| 21 | + def setUp(self): |
| 22 | + delete_cached() |
| 23 | + cleanup() |
| 24 | + inputstreamhelper.system_os = lambda: 'Windows' |
| 25 | + inputstreamhelper.widevine.repo.system_os = lambda: 'Windows' |
| 26 | + |
| 27 | + def test_check_inputstream_mpd(self): |
| 28 | + platform.machine = lambda: 'ARM64' |
| 29 | + is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha') |
| 30 | + is_helper.remove_widevine() |
| 31 | + is_installed = is_helper.check_inputstream() |
| 32 | + self.assertTrue(is_installed, True) |
| 33 | + |
| 34 | + def test_check_inputstream_hls_again(self): |
| 35 | + platform.machine = lambda: 'ARM64' |
| 36 | + platform.architecture = lambda: ['64bit', ''] |
| 37 | + is_helper = inputstreamhelper.Helper('hls', drm='com.widevine.alpha') |
| 38 | + is_installed = is_helper.check_inputstream() |
| 39 | + self.assertTrue(is_installed, True) |
| 40 | + |
| 41 | + def test_check_inputstream_rtmp(self): |
| 42 | + platform.machine = lambda: 'ARM64' |
| 43 | + is_helper = inputstreamhelper.Helper('rtmp') |
| 44 | + is_installed = is_helper.check_inputstream() |
| 45 | + self.assertTrue(is_installed, True) |
| 46 | + |
| 47 | + def test_check_inputstream_disabled(self): |
| 48 | + platform.machine = lambda: 'ARM64' |
| 49 | + is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha') |
| 50 | + is_helper.disable() |
| 51 | + is_installed = is_helper.check_inputstream() |
| 52 | + is_helper.enable() |
| 53 | + self.assertTrue(is_installed, True) |
| 54 | + |
| 55 | + |
| 56 | +if __name__ == '__main__': |
| 57 | + unittest.main() |
0 commit comments